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:
parent
1c3c25d982
commit
c4215f72c5
2 changed files with 10 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue