mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-01 21:35:40 +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(IBasicType.t_int, ((ICPPBasicType) t3).getType());
|
||||||
assertEquals(ICPPBasicType.IS_LONG, ((ICPPBasicType) t3).getQualifierBits());
|
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,8 +366,10 @@ 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
|
// 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
|
// 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;
|
return binding;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
boolean template = false;
|
boolean template = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue