isDeclarationSpecifier performs error recovers which jostles the token
stream. Specifically, TryAnnotateTypeOrScopeToken will end up consuming
a typename token which will confuse the attribute parsing machinery as
we no-longer have something identifier-like.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224903
91177308-0d34-0410-b5e6-
96231b3b80d8
continue;
// Expect an identifier or declaration specifier (const, int, etc.)
- if (Tok.isNot(tok::identifier) && !isDeclarationSpecifier())
+ if (Tok.isNot(tok::identifier) && !isTypeQualifier() &&
+ !isKnownToBeTypeSpecifier(Tok))
break;
IdentifierInfo *AttrName = Tok.getIdentifierInfo();
typedef int __attribute__((aligned(int(1)))) T1;
typedef int __attribute__((aligned(int))) T2; // expected-error {{expected '(' for function-style cast}}
}
+
+__attribute((typename)) int x; // expected-error {{expected ')'}}
{
}
-namespace B __attribute__ (( static )) = A; // expected-error{{attributes cannot be specified on namespace alias}}
+namespace B __attribute__ (( const )) = A; // expected-error{{attributes cannot be specified on namespace alias}}