mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 02:36:01 +02:00
fix bug 98784
This commit is contained in:
parent
164b25ecae
commit
6461cf1c92
2 changed files with 18 additions and 0 deletions
|
@ -1657,4 +1657,20 @@ public class AST2TemplateTests extends AST2BaseTest {
|
||||||
|
|
||||||
assertSame( i, col.getName(14).resolveBinding() );
|
assertSame( i, col.getName(14).resolveBinding() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testBug98784() throws Exception {
|
||||||
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
buffer.append("class A { \n"); //$NON-NLS-1$
|
||||||
|
buffer.append(" template <class T > void f( T ) { \n"); //$NON-NLS-1$
|
||||||
|
buffer.append(" begin(); \n"); //$NON-NLS-1$
|
||||||
|
buffer.append(" } \n"); //$NON-NLS-1$
|
||||||
|
buffer.append(" void begin(); \n"); //$NON-NLS-1$
|
||||||
|
buffer.append("}; \n"); //$NON-NLS-1$
|
||||||
|
|
||||||
|
IASTTranslationUnit tu = parse( buffer.toString(), ParserLanguage.CPP );
|
||||||
|
CPPNameCollector col = new CPPNameCollector();
|
||||||
|
tu.accept( col );
|
||||||
|
|
||||||
|
assertSame( col.getName(5).resolveBinding(), col.getName(6).resolveBinding() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -297,6 +297,8 @@ public class CPPSemantics {
|
||||||
parent = parent.getParent();
|
parent = parent.getParent();
|
||||||
}
|
}
|
||||||
if( parent instanceof IASTFunctionDefinition ){
|
if( parent instanceof IASTFunctionDefinition ){
|
||||||
|
while( parent.getParent() instanceof ICPPASTTemplateDeclaration )
|
||||||
|
parent = parent.getParent();
|
||||||
if( parent.getPropertyInParent() != IASTCompositeTypeSpecifier.MEMBER_DECLARATION )
|
if( parent.getPropertyInParent() != IASTCompositeTypeSpecifier.MEMBER_DECLARATION )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue