Created attachment 13478 [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/Sema/SemaAccess.cpp:737: AccessResult HasAccess(clang::Sema &, const (anonymous namespace)::EffectiveContext &, const clang::CXXRecordDecl *, clang::AccessSpecifier, const (anonymous namespace)::AccessTarget &): Assertion `Access == AS_private || Access == AS_protected' failed.
reasonable test case: struct B { template <struct U : U { } > void f(); };
*** Bug 22055 has been marked as a duplicate of this bug. ***
Slightly different test case: struct A { template <class B {}, B> void f() {} };
Another one: template <typename T> struct U; struct A { enum { X = U<struct B{}>::val, Y = sizeof(B) }; }; All of these test cases define a struct that gets an access specifier of AS_none, but the struct ends up hanging out in a RecordDecl, confusing access control.
None of these examples crash anymore.