mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Using declarations in combination with nested classes, bug 209582.
This commit is contained in:
parent
c754042629
commit
e08ec31825
2 changed files with 21 additions and 1 deletions
|
@ -5667,4 +5667,24 @@ public class AST2CPPTests extends AST2BaseTest {
|
|||
assertEquals(1, tu.getDefinitionsInAST(b).length); // using-decl
|
||||
assertEquals(2, tu.getDeclarationsInAST(b).length); // using-decl + func-decl
|
||||
}
|
||||
|
||||
|
||||
// namespace x {
|
||||
// int a;
|
||||
// }
|
||||
// using namespace x;
|
||||
// class O {
|
||||
// class I {
|
||||
// void f();
|
||||
// };
|
||||
// };
|
||||
// void O::I::f() {
|
||||
// a=0;
|
||||
// }
|
||||
public void testUsingDirectiveWithNestedClass_Bug209582() throws Exception {
|
||||
BindingAssertionHelper bh= new BindingAssertionHelper(getContents(1)[0].toString(), true);
|
||||
|
||||
IBinding b= bh.assertNonProblem("a=", 1);
|
||||
assertEquals("x", b.getScope().getScopeName().toString());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1108,7 +1108,7 @@ public class CPPSemantics {
|
|||
HashSet<ICPPNamespaceScope> handled= new HashSet<ICPPNamespaceScope>();
|
||||
for( int i = 0; i < uds.length; i++ ){
|
||||
final ICPPUsingDirective ud = uds[i];
|
||||
if( CPPSemantics.declaredBefore( ud, blockItem ) ){
|
||||
if( CPPSemantics.declaredBefore( ud, data.astName ) ){
|
||||
storeUsingDirective(data, blockScope, ud, handled);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue