Fix for PR4794 (instantiating friend class decl); this version shouldn't

cause any regressions.

llvm-svn: 80277
This commit is contained in:
Eli Friedman 2009-08-27 19:11:42 +00:00
parent 880a348b52
commit bda4ef15ce
2 changed files with 5 additions and 2 deletions

View File

@ -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);

View File

@ -1,5 +1,4 @@
// RUN: clang-cc -fsyntax-only -verify %s
// XFAIL
// PR4794
template <class T> class X