mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 02:36:01 +02:00
Bug 342443: A using declaration is not a definition.
This commit is contained in:
parent
dfd434ea2e
commit
c9e1a95b39
2 changed files with 13 additions and 1 deletions
|
@ -9379,4 +9379,16 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
public void testOverloadedOperatorWithInheritanceDistance_335387() throws Exception {
|
public void testOverloadedOperatorWithInheritanceDistance_335387() throws Exception {
|
||||||
parseAndCheckBindings();
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class CPPASTUsingDeclaration extends ASTNode
|
||||||
|
|
||||||
public int getRoleForName(IASTName n) {
|
public int getRoleForName(IASTName n) {
|
||||||
if (n == name)
|
if (n == name)
|
||||||
return r_definition;
|
return r_declaration;
|
||||||
return r_unclear;
|
return r_unclear;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue