1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-31 04:45:38 +02:00

Typedef recursion, bug 285457.

This commit is contained in:
Markus Schorn 2009-08-04 15:38:40 +00:00
parent 1c3c25d982
commit c4215f72c5
2 changed files with 10 additions and 2 deletions

View file

@ -7330,4 +7330,10 @@ public class AST2CPPTests extends AST2BaseTest {
assertEquals(IBasicType.t_int, ((ICPPBasicType) t3).getType());
assertEquals(ICPPBasicType.IS_LONG, ((ICPPBasicType) t3).getQualifierBits());
}
// typedef enum enum_name enum_name;
public void testTypedefRecursion_285457() throws Exception {
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
ba.assertProblem("enum_name", 9);
}
}

View file

@ -366,9 +366,11 @@ public class CPPVisitor extends ASTQueries {
// 7.1.5.3-2 ... If name lookup does not find a declaration for the name, the elaborated-type-specifier is ill-formed
// unless it is of the simple form class-key identifier
if (mustBeSimple && elabType.getName() instanceof ICPPASTQualifiedName)
if (mustBeSimple &&
(elabType.getName() instanceof ICPPASTQualifiedName || elabType.getKind() == IASTElaboratedTypeSpecifier.k_enum)) {
return binding;
}
try {
boolean template = false;
ICPPScope scope = (ICPPScope) getContainingScope(name);