mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
fix bug 86827
This commit is contained in:
parent
145891c763
commit
12cdf18a80
2 changed files with 20 additions and 1 deletions
|
@ -2651,5 +2651,23 @@ public class AST2CPPTests extends AST2BaseTest {
|
|||
assertInstances( col, x, 2 );
|
||||
assertInstances( col, f, 2 );
|
||||
}
|
||||
|
||||
public void testBug86827() throws Exception {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append("struct C { \n"); //$NON-NLS-1$
|
||||
buffer.append(" int c; \n"); //$NON-NLS-1$
|
||||
buffer.append(" C() : c(0) { } \n"); //$NON-NLS-1$
|
||||
buffer.append("}; \n"); //$NON-NLS-1$
|
||||
|
||||
IASTTranslationUnit tu = parse(buffer.toString(), ParserLanguage.CPP);
|
||||
CPPNameCollector col = new CPPNameCollector();
|
||||
tu.getVisitor().visitTranslationUnit(col);
|
||||
|
||||
IVariable c = (IVariable) col.getName(1).resolveBinding();
|
||||
|
||||
IASTName [] refs = tu.getReferences( c );
|
||||
assertEquals( refs.length, 1 );
|
||||
assertSame( refs[0], col.getName(3) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -985,7 +985,8 @@ public class CPPVisitor implements ICPPASTVisitor {
|
|||
prop == ICPPASTUsingDeclaration.NAME ||
|
||||
prop == IASTFunctionCallExpression.FUNCTION_NAME ||
|
||||
prop == ICPPASTUsingDeclaration.NAME ||
|
||||
prop == IASTNamedTypeSpecifier.NAME)
|
||||
prop == IASTNamedTypeSpecifier.NAME ||
|
||||
prop == ICPPASTConstructorChainInitializer.MEMBER_ID)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue