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:
parent
fedc95ad12
commit
59e8ca66d9
2 changed files with 22 additions and 0 deletions
|
@ -4289,4 +4289,22 @@ public class AST2CPPTests extends AST2BaseTest {
|
|||
ICPPFunction trace = (ICPPFunction) col.getName(0).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() );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1396,6 +1396,10 @@ public class CPPVisitor {
|
|||
}
|
||||
|
||||
IASTName name = fnDtor.getName();
|
||||
if( name instanceof ICPPASTQualifiedName ){
|
||||
IASTName [] ns = ((ICPPASTQualifiedName)name).getNames();
|
||||
name = ns[ ns.length - 1 ];
|
||||
}
|
||||
if( name instanceof ICPPASTConversionName ){
|
||||
returnType = createType( ((ICPPASTConversionName)name).getTypeId() );
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue