Created attachment 13487 [details] test case Fuzzing discovered that the attached test case, when given as input to clang -fno-crash-diagnostics -std=c++11 -xc++ -c -emit-llvm causes this assertion failure: clang-3.6: tools/clang/include/clang/Lex/Token.h:163: clang::IdentifierInfo *clang::Token::getIdentifierInfo() const: Assertion `!isAnnotation() && "getIdentifierInfo() on an annotation token!"' failed.
Fixed in clang head. % ./clang -fno-crash-diagnostics -std=c++11 -xc++ -c -emit-llvm lex_crash.cpp lex_crash.cpp:2:15: error: declaration of anonymous struct must be a definition struct A::X < struct T ^ lex_crash.cpp:3:1: error: expected a type ^ lex_crash.cpp:2:11: error: explicit specialization of non-template struct 'X' struct A::X < struct T ^ lex_crash.cpp:2:11: error: no struct named 'X' in 'A<T>' struct A::X < struct T ~~~^ lex_crash.cpp:3:1: error: expected member name or ';' after declaration specifiers ^ lex_crash.cpp:3:1: error: expected '}' lex_crash.cpp:1:32: note: to match this '{' template <typename T> struct A { ^ lex_crash.cpp:2:23: error: expected ';' after struct struct A::X < struct T ^ ; 7 errors generated.