diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-08-27 19:11:42 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-08-27 19:11:42 +0000 |
commit | eaba1af8529c381d7bfd4dd0a8b48d2c01647972 (patch) | |
tree | 105dc7a7fca9a1da5a5822d15b82abde455bf91d | |
parent | e74b32a328b73fbce7944efdb3861c4f09755fcf (diff) |
Fix for PR4794 (instantiating friend class decl); this version shouldn't
cause any regressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80277 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 6 | ||||
-rw-r--r-- | test/SemaTemplate/instantiate-friend-class.cpp | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index a79742b5b1..a0353e3c53 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -416,7 +416,11 @@ Decl *TemplateDeclInstantiator::VisitCXXRecordDecl(CXXRecordDecl *D) { D->getLocation(), D->getIdentifier(), D->getTagKeywordLoc(), PrevDecl); Record->setImplicit(D->isImplicit()); - Record->setAccess(D->getAccess()); + // FIXME: Check against AS_none is an ugly hack to work around the issue that + // the tag decls introduced by friend class declarations don't have an access + // specifier. Remove once this area of the code gets sorted out. + if (D->getAccess() != AS_none) + Record->setAccess(D->getAccess()); if (!D->isInjectedClassName()) Record->setInstantiationOfMemberClass(D); diff --git a/test/SemaTemplate/instantiate-friend-class.cpp b/test/SemaTemplate/instantiate-friend-class.cpp index 424419d390..9a4a73cc8a 100644 --- a/test/SemaTemplate/instantiate-friend-class.cpp +++ b/test/SemaTemplate/instantiate-friend-class.cpp @@ -1,5 +1,4 @@ // RUN: clang-cc -fsyntax-only -verify %s -// XFAIL // PR4794 template <class T> class X |