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:
parent
b3f9f20ed8
commit
10298b85c7
2 changed files with 18 additions and 1 deletions
|
@ -3736,5 +3736,21 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
IBinding r = col.getName(13).resolveBinding();
|
IBinding r = col.getName(13).resolveBinding();
|
||||||
assertSame( d2, r );
|
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 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -273,7 +273,8 @@ public class CPPSemantics {
|
||||||
prop == ICPPASTUsingDirective.QUALIFIED_NAME ||
|
prop == ICPPASTUsingDirective.QUALIFIED_NAME ||
|
||||||
prop == ICPPASTUsingDeclaration.NAME ||
|
prop == ICPPASTUsingDeclaration.NAME ||
|
||||||
prop == IASTFunctionCallExpression.FUNCTION_NAME ||
|
prop == IASTFunctionCallExpression.FUNCTION_NAME ||
|
||||||
prop == IASTNamedTypeSpecifier.NAME )
|
prop == IASTNamedTypeSpecifier.NAME ||
|
||||||
|
prop == ICPPASTConstructorChainInitializer.MEMBER_ID )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue