summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp5
-rw-r--r--clang/test/SemaTemplate/instantiate-friend-class.cpp2
2 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 1e1b6e8b3e9..045c12aab54 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -4311,10 +4311,7 @@ CreateNewDecl:
New->setLexicalDeclContext(CurContext);
// Set the access specifier.
- // 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)
+ if (!Invalid && TUK != TUK_Friend)
SetMemberAccessSpecifier(New, PrevDecl, AS);
if (TUK == TUK_Definition)
diff --git a/clang/test/SemaTemplate/instantiate-friend-class.cpp b/clang/test/SemaTemplate/instantiate-friend-class.cpp
index 004bf1b7499..424419d390f 100644
--- a/clang/test/SemaTemplate/instantiate-friend-class.cpp
+++ b/clang/test/SemaTemplate/instantiate-friend-class.cpp
@@ -1,4 +1,6 @@
// RUN: clang-cc -fsyntax-only -verify %s
+// XFAIL
+// PR4794
template <class T> class X
{
OpenPOWER on IntegriCloud