PR4794: Make instantiating friend class decls not crash.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80272 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 045c12a..1e1b6e8 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -4311,7 +4311,10 @@
New->setLexicalDeclContext(CurContext);
// Set the access specifier.
- if (!Invalid && TUK != TUK_Friend)
+ // FIXME: This used to be skipped for friend tag decls, but it led to an
+ // assertion in Decl::CheckAccessDeclContext(); once various issues with
+ // friend class decls are sorted out, this should be revisited.
+ if (!Invalid)
SetMemberAccessSpecifier(New, PrevDecl, AS);
if (TUK == TUK_Definition)