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 415d87d9750..c7493b8968a 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 @@ -9379,4 +9379,16 @@ public class AST2CPPTests extends AST2BaseTest { public void testOverloadedOperatorWithInheritanceDistance_335387() throws Exception { parseAndCheckBindings(); } + + // namespace ns {int a;} + // using ns::a; + public void testPropertyOfUsingDeclaration() throws Exception { + IASTTranslationUnit tu= parseAndCheckBindings(); + ICPPASTUsingDeclaration udecl= getDeclaration(tu, 1); + ICPPASTQualifiedName qn= (ICPPASTQualifiedName) udecl.getName(); + assertFalse(qn.isDefinition()); + assertFalse(qn.getLastName().isDefinition()); + assertTrue(qn.isDeclaration()); + assertTrue(qn.getLastName().isDeclaration()); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTUsingDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTUsingDeclaration.java index 8a81878f2b4..42da29c2247 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTUsingDeclaration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTUsingDeclaration.java @@ -99,7 +99,7 @@ public class CPPASTUsingDeclaration extends ASTNode public int getRoleForName(IASTName n) { if (n == name) - return r_definition; + return r_declaration; return r_unclear; }