1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

fix bug 91773: allow constructor chain initializers to look in the whole class scope for bindings

This commit is contained in:
Andrew Niefer 2005-04-26 21:51:03 +00:00
parent b3f9f20ed8
commit 10298b85c7
2 changed files with 18 additions and 1 deletions

View file

@ -3736,5 +3736,21 @@ public class AST2CPPTests extends AST2BaseTest {
IBinding r = col.getName(13).resolveBinding();
assertSame( d2, r );
}
public void testBug91773() throws Exception {
StringBuffer buffer = new StringBuffer();
buffer.append("class P { \n"); //$NON-NLS-1$
buffer.append(" Point() : xCoord(0) {} \n"); //$NON-NLS-1$
buffer.append(" int xCoord; \n"); //$NON-NLS-1$
buffer.append("}; \n"); //$NON-NLS-1$
IASTTranslationUnit tu = parse( buffer.toString(), ParserLanguage.CPP ); //$NON-NLS-1$
CPPNameCollector col = new CPPNameCollector();
tu.accept( col );
ICPPField x = (ICPPField) col.getName(2).resolveBinding();
ICPPField x2 = (ICPPField) col.getName(3).resolveBinding();
assertSame( x, x2 );
}
}

View file

@ -273,7 +273,8 @@ public class CPPSemantics {
prop == ICPPASTUsingDirective.QUALIFIED_NAME ||
prop == ICPPASTUsingDeclaration.NAME ||
prop == IASTFunctionCallExpression.FUNCTION_NAME ||
prop == IASTNamedTypeSpecifier.NAME )
prop == IASTNamedTypeSpecifier.NAME ||
prop == ICPPASTConstructorChainInitializer.MEMBER_ID )
{
return true;
}