mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
file names in problem bindings, and don't report type problems if nothing was found
This commit is contained in:
parent
3119b13099
commit
c739209ea0
2 changed files with 10 additions and 4 deletions
|
@ -17,8 +17,10 @@ package org.eclipse.cdt.internal.core.dom.parser;
|
|||
import java.text.MessageFormat;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTFileLocation;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNodeLocation;
|
||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||
|
@ -83,7 +85,9 @@ public class ProblemBinding implements IProblemBinding, IType, IScope {
|
|||
msg = MessageFormat.format(msg, new Object[] { new String(arg) });
|
||||
}
|
||||
|
||||
Object[] args = new Object[] { msg, new String("") /*file*/, new Integer(0) /*line*/}; //$NON-NLS-1$
|
||||
IASTNodeLocation [] locs = node.getNodeLocations();
|
||||
IASTFileLocation fileLoc = node.getTranslationUnit().flattenLocationsToFile( locs );
|
||||
Object[] args = new Object[] { msg, fileLoc.getFileName(), new Integer(-1) }; //$NON-NLS-1$
|
||||
message = ParserMessages.getFormattedString(PROBLEM_PATTERN, args);
|
||||
return message;
|
||||
}
|
||||
|
|
|
@ -462,8 +462,10 @@ public class CPPSemantics {
|
|||
}
|
||||
|
||||
}
|
||||
if( data.astName.getPropertyInParent() == IASTNamedTypeSpecifier.NAME && !( binding instanceof IType || binding instanceof ICPPConstructor) ){
|
||||
binding = new ProblemBinding( data.astName, IProblemBinding.SEMANTIC_INVALID_TYPE, data.name );
|
||||
if( binding != null ) {
|
||||
if( data.astName.getPropertyInParent() == IASTNamedTypeSpecifier.NAME && !( binding instanceof IType || binding instanceof ICPPConstructor) ){
|
||||
binding = new ProblemBinding( data.astName, IProblemBinding.SEMANTIC_INVALID_TYPE, data.name );
|
||||
}
|
||||
}
|
||||
|
||||
if( binding != null && !( binding instanceof IProblemBinding ) ){
|
||||
|
|
Loading…
Add table
Reference in a new issue