Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2005-07-08 12:07:44 -0400
committerAndrew Niefer2005-07-08 12:07:44 -0400
commit609f1f0233b996fe185c5541fe3e1bdb427dda5d (patch)
tree077ff76fe4fdc2bcfa1a11953b98bccc8ff819c6
parent765f1256221fe5f05537a16b326284f29fa331cc (diff)
downloadorg.eclipse.cdt-609f1f0233b996fe185c5541fe3e1bdb427dda5d.tar.gz
org.eclipse.cdt-609f1f0233b996fe185c5541fe3e1bdb427dda5d.tar.xz
org.eclipse.cdt-609f1f0233b996fe185c5541fe3e1bdb427dda5d.zip
modified patch from Devin Steffler for bug 102764
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java
index 6b2276a732..b9132ea5d5 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java
@@ -884,7 +884,7 @@ public class CPPSemantics {
static private ICPPScope getLookupScope( IASTName name ) throws DOMException{
IASTNode parent = name.getParent();
-
+ IScope scope = null;
if( parent instanceof ICPPASTBaseSpecifier ) {
ICPPASTCompositeTypeSpecifier compSpec = (ICPPASTCompositeTypeSpecifier) parent.getParent();
IASTName n = compSpec.getName();
@@ -893,14 +893,21 @@ public class CPPSemantics {
n = ns[ ns.length - 1 ];
}
- return (ICPPScope) CPPVisitor.getContainingScope( n );
+ scope = CPPVisitor.getContainingScope( n );
} else if( parent instanceof ICPPASTConstructorChainInitializer ){
ICPPASTConstructorChainInitializer initializer = (ICPPASTConstructorChainInitializer) parent;
IASTFunctionDeclarator dtor = (IASTFunctionDeclarator) initializer.getParent();
- return (ICPPScope) dtor.getName().resolveBinding().getScope();
-
+ IBinding binding = dtor.getName().resolveBinding();
+ if( !(binding instanceof IProblemBinding) )
+ scope = binding.getScope();
+ } else {
+ scope = CPPVisitor.getContainingScope( name );
}
- return (ICPPScope) CPPVisitor.getContainingScope( name );
+ if( scope instanceof ICPPScope )
+ return (ICPPScope)scope;
+ else if( scope instanceof IProblemBinding )
+ return new CPPScope.CPPScopeProblem( ((IProblemBinding)scope).getASTNode(), IProblemBinding.SEMANTIC_BAD_SCOPE, ((IProblemBinding)scope).getNameCharArray() );
+ return new CPPScope.CPPScopeProblem( name, IProblemBinding.SEMANTIC_BAD_SCOPE, name.toCharArray() );
}
private static void mergeResults( LookupData data, Object results, boolean scoped ){
if( !data.prefixLookup ){

Back to the top