<div dir="ltr">Should be fixed with r225118.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 3, 2015 at 8:34 AM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sun, Dec 28, 2014 at 5:28 PM, David Majnemer<br>
<<a href="mailto:david.majnemer@gmail.com">david.majnemer@gmail.com</a>> wrote:<br>
</span><div><div class="h5">> Author: majnemer<br>
> Date: Sun Dec 28 16:28:32 2014<br>
> New Revision: 224903<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=224903&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=224903&view=rev</a><br>
> Log:<br>
> Parse: Don't crash when 'typename' shows up in an attribute<br>
><br>
> isDeclarationSpecifier performs error recovers which jostles the token<br>
> stream.  Specifically, TryAnnotateTypeOrScopeToken will end up consuming<br>
> a typename token which will confuse the attribute parsing machinery as<br>
> we no-longer have something identifier-like.<br>
><br>
> Modified:<br>
>     cfe/trunk/lib/Parse/ParseDecl.cpp<br>
>     cfe/trunk/test/Parser/cxx-attributes.cpp<br>
>     cfe/trunk/test/Parser/namespace-alias-attr.cpp<br>
><br>
> Modified: cfe/trunk/lib/Parse/ParseDecl.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=224903&r1=224902&r2=224903&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=224903&r1=224902&r2=224903&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/Parse/ParseDecl.cpp (original)<br>
> +++ cfe/trunk/lib/Parse/ParseDecl.cpp Sun Dec 28 16:28:32 2014<br>
> @@ -143,7 +143,8 @@ void Parser::ParseGNUAttributes(ParsedAt<br>
>          continue;<br>
><br>
>        // Expect an identifier or declaration specifier (const, int, etc.)<br>
> -      if (Tok.isNot(tok::identifier) && !isDeclarationSpecifier())<br>
> +      if (Tok.isNot(tok::identifier) && !isTypeQualifier() &&<br>
> +          !isKnownToBeTypeSpecifier(Tok))<br>
>          break;<br>
><br>
>        IdentifierInfo *AttrName = Tok.getIdentifierInfo();<br>
><br>
> Modified: cfe/trunk/test/Parser/cxx-attributes.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/cxx-attributes.cpp?rev=224903&r1=224902&r2=224903&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/cxx-attributes.cpp?rev=224903&r1=224902&r2=224903&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/test/Parser/cxx-attributes.cpp (original)<br>
> +++ cfe/trunk/test/Parser/cxx-attributes.cpp Sun Dec 28 16:28:32 2014<br>
> @@ -20,3 +20,5 @@ namespace PR17666 {<br>
>    typedef int __attribute__((aligned(int(1)))) T1;<br>
>    typedef int __attribute__((aligned(int))) T2; // expected-error {{expected '(' for function-style cast}}<br>
>  }<br>
> +<br>
> +__attribute((typename)) int x; // expected-error {{expected ')'}}<br>
><br>
> Modified: cfe/trunk/test/Parser/namespace-alias-attr.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/namespace-alias-attr.cpp?rev=224903&r1=224902&r2=224903&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/namespace-alias-attr.cpp?rev=224903&r1=224902&r2=224903&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/test/Parser/namespace-alias-attr.cpp (original)<br>
> +++ cfe/trunk/test/Parser/namespace-alias-attr.cpp Sun Dec 28 16:28:32 2014<br>
> @@ -4,5 +4,5 @@ namespace A<br>
>  {<br>
>  }<br>
><br>
> -namespace B __attribute__ (( static )) = A; // expected-error{{attributes cannot be specified on namespace alias}}<br>
> +namespace B __attribute__ (( const )) = A; // expected-error{{attributes cannot be specified on namespace alias}}<br>
<br>
</div></div>Also, while I'm at it... why did this test change in this way?<br>
<span class="HOEnZb"><font color="#888888"><br>
~Aaron<br>
</font></span></blockquote></div><br></div>