Created attachment 13507 [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/lib/AST/DeclBase.cpp:1162: void clang::DeclContext::removeDecl(clang::Decl *): Assertion `Pos != Map->end() && "no lookup entry for decl"' failed.
Does not crash anymore: $ clang --target=x86_64-linux -c -std=c++11 no-lookup-entry.cpp no-lookup-entry.cpp:4:46: error: template specialization or definition requires a template parameter list corresponding to the nested type 'S<A>' template<typename A> template<( struct S<A>::T {}; ^ no-lookup-entry.cpp:4:46: error: 'T' cannot be defined in a parameter type no-lookup-entry.cpp:4:50: error: expected ')' template<typename A> template<( struct S<A>::T {}; ^ no-lookup-entry.cpp:4:31: note: to match this '(' template<typename A> template<( struct S<A>::T {}; ^ no-lookup-entry.cpp:4:50: error: expected template parameter template<typename A> template<( struct S<A>::T {}; ^ no-lookup-entry.cpp:4:50: error: expected ',' or '>' in template-parameter-list no-lookup-entry.cpp:4:50: warning: declaration does not declare anything [-Wmissing-declarations] no-lookup-entry.cpp:5:18: error: expected '}' static void g() { ^ no-lookup-entry.cpp:5:17: note: to match this '{' static void g() { ^ 1 warning and 6 errors generated.