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

fix bug 95692

This commit is contained in:
Andrew Niefer 2005-05-18 18:40:16 +00:00
parent fedc95ad12
commit 59e8ca66d9
2 changed files with 22 additions and 0 deletions

View file

@ -4289,4 +4289,22 @@ public class AST2CPPTests extends AST2BaseTest {
ICPPFunction trace = (ICPPFunction) col.getName(0).resolveBinding(); ICPPFunction trace = (ICPPFunction) col.getName(0).resolveBinding();
assertSame( trace, col.getName(7).resolveBinding() ); assertSame( trace, col.getName(7).resolveBinding() );
} }
public void testBug95692() throws Exception {
StringBuffer buffer = new StringBuffer();
buffer.append("class RTCharacter { \n"); //$NON-NLS-1$
buffer.append(" char value; \n"); //$NON-NLS-1$
buffer.append(" public: operator char (void) const; \n"); //$NON-NLS-1$
buffer.append("}; \n"); //$NON-NLS-1$
buffer.append("RTCharacter::operator char( void )const { \n"); //$NON-NLS-1$
buffer.append(" return value; \n"); //$NON-NLS-1$
buffer.append("} \n"); //$NON-NLS-1$
IASTTranslationUnit tu = parse( buffer.toString(), ParserLanguage.CPP );
CPPNameCollector col = new CPPNameCollector();
tu.accept(col);
ICPPMethod op = (ICPPMethod) col.getName(2).resolveBinding();
assertSame( op, col.getName(6).resolveBinding() );
}
} }

View file

@ -1396,6 +1396,10 @@ public class CPPVisitor {
} }
IASTName name = fnDtor.getName(); IASTName name = fnDtor.getName();
if( name instanceof ICPPASTQualifiedName ){
IASTName [] ns = ((ICPPASTQualifiedName)name).getNames();
name = ns[ ns.length - 1 ];
}
if( name instanceof ICPPASTConversionName ){ if( name instanceof ICPPASTConversionName ){
returnType = createType( ((ICPPASTConversionName)name).getTypeId() ); returnType = createType( ((ICPPASTConversionName)name).getTypeId() );
} else { } else {