diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java index 2cc949f3faa..2a6472a87e2 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java @@ -5645,7 +5645,7 @@ public class AST2CPPTests extends AST2BaseTest { // using ns::A; // // class B: public A {}; - public void _testBug235196() throws Exception { + public void testBug235196() throws Exception { parseAndCheckBindings(getAboveComment()); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUsingDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUsingDeclaration.java index 5d732252ca5..c3ce2a8575b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUsingDeclaration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUsingDeclaration.java @@ -28,14 +28,14 @@ import org.eclipse.core.runtime.PlatformObject; /** * @author aniefer */ -public class CPPUsingDeclaration extends PlatformObject implements ICPPUsingDeclaration, ICPPInternalBinding{ +public class CPPUsingDeclaration extends PlatformObject implements ICPPUsingDeclaration, ICPPInternalBinding { private IASTName name; - private IBinding [] delegates; + private IBinding[] delegates; - public CPPUsingDeclaration( IASTName name, IBinding [] bindings ) { - if( name instanceof ICPPASTQualifiedName ){ - IASTName [] ns = ((ICPPASTQualifiedName)name).getNames(); - name = ns[ ns.length - 1 ]; + public CPPUsingDeclaration(IASTName name, IBinding[] bindings) { + if (name instanceof ICPPASTQualifiedName) { + IASTName[] ns = ((ICPPASTQualifiedName) name).getNames(); + name = ns[ns.length - 1]; } this.name = name; this.delegates= bindings; @@ -46,17 +46,17 @@ public class CPPUsingDeclaration extends PlatformObject implements ICPPUsingDecl } public String[] getQualifiedName() { - return CPPVisitor.getQualifiedName( this ); + return CPPVisitor.getQualifiedName(this); } public char[][] getQualifiedNameCharArray() { - return CPPVisitor.getQualifiedNameCharArray( this ); + return CPPVisitor.getQualifiedNameCharArray(this); } public boolean isGloballyQualified() throws DOMException { IScope scope = getScope(); - while( scope != null ){ - if( scope instanceof ICPPBlockScope ) + while (scope != null) { + if(scope instanceof ICPPBlockScope) return false; scope = scope.getParent(); } @@ -72,7 +72,7 @@ public class CPPUsingDeclaration extends PlatformObject implements ICPPUsingDecl } public IScope getScope() { - return CPPVisitor.getContainingScope( name.getParent() ); + return CPPVisitor.getContainingScope(name.getParent()); } public IASTNode[] getDeclarations() { @@ -81,19 +81,19 @@ public class CPPUsingDeclaration extends PlatformObject implements ICPPUsingDecl public IASTNode getDefinition() { IASTNode n = name.getParent(); - if( n instanceof ICPPASTTemplateId ) + if (n instanceof ICPPASTTemplateId) n = n.getParent(); return n; } - public void addDefinition( IASTNode node ) { + public void addDefinition(IASTNode node) { } - public void addDeclaration( IASTNode node ) { + public void addDeclaration(IASTNode node) { } - public void removeDeclaration( IASTNode node ) { + public void removeDeclaration(IASTNode node) { } public ILinkage getLinkage() { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java index c25c38eef9c..e6a3179447f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java @@ -1517,8 +1517,9 @@ public class CPPSemantics { return null; } if (candidate != null) { - if (candidate instanceof IType == false && candidate instanceof ICPPNamespace == false - && LookupData.typesOnly(name)) { + if (!(candidate instanceof IType) && !(candidate instanceof ICPPNamespace) && + !(candidate instanceof ICPPUsingDeclaration) && + LookupData.typesOnly(name)) { return null; }