mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
fix bug 98502, types of typedefed enums
This commit is contained in:
parent
30084a7e84
commit
77ec35c624
2 changed files with 14 additions and 1 deletions
|
@ -3133,4 +3133,14 @@ public class AST2Tests extends AST2BaseTest {
|
|||
tu.accept(col);
|
||||
assertNoProblemBindings(col);
|
||||
}
|
||||
|
||||
public void testBug98502() throws Exception {
|
||||
IASTTranslationUnit tu = parse("typedef enum { ONE } e;", ParserLanguage.C, true, true );
|
||||
CNameCollector col = new CNameCollector();
|
||||
tu.accept(col);
|
||||
|
||||
IEnumeration etion = (IEnumeration) col.getName(0).resolveBinding();
|
||||
ITypedef e = (ITypedef) col.getName(2).resolveBinding();
|
||||
assertSame( e.getType(), etion );
|
||||
}
|
||||
}
|
|
@ -1643,7 +1643,10 @@ public class CVisitor {
|
|||
} else if( declSpec instanceof IASTElaboratedTypeSpecifier ){
|
||||
name = ((IASTElaboratedTypeSpecifier) declSpec).getName();
|
||||
} else if( declSpec instanceof IASTCompositeTypeSpecifier ){
|
||||
name = ((IASTCompositeTypeSpecifier) declSpec).getName(); }
|
||||
name = ((IASTCompositeTypeSpecifier) declSpec).getName();
|
||||
} else if( declSpec instanceof IASTEnumerationSpecifier ){
|
||||
name = ((IASTEnumerationSpecifier)declSpec).getName();
|
||||
}
|
||||
|
||||
binding = name.resolveBinding();
|
||||
if( binding instanceof IType )
|
||||
|
|
Loading…
Add table
Reference in a new issue