[cfe-commits] r80277 - in /cfe/trunk: lib/Sema/SemaTemplateInstantiateDecl.cpp test/SemaTemplate/instantiate-friend-class.cpp

Eli Friedman eli.friedman at gmail.com
Thu Aug 27 12:11:42 PDT 2009


Author: efriedma
Date: Thu Aug 27 14:11:42 2009
New Revision: 80277

URL: http://llvm.org/viewvc/llvm-project?rev=80277&view=rev
Log:
Fix for PR4794 (instantiating friend class decl); this version shouldn't 
cause any regressions.


Modified:
    cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
    cfe/trunk/test/SemaTemplate/instantiate-friend-class.cpp

Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=80277&r1=80276&r2=80277&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Thu Aug 27 14:11:42 2009
@@ -416,7 +416,11 @@
                             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);
 

Modified: cfe/trunk/test/SemaTemplate/instantiate-friend-class.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-friend-class.cpp?rev=80277&r1=80276&r2=80277&view=diff

==============================================================================
--- cfe/trunk/test/SemaTemplate/instantiate-friend-class.cpp (original)
+++ cfe/trunk/test/SemaTemplate/instantiate-friend-class.cpp Thu Aug 27 14:11:42 2009
@@ -1,5 +1,4 @@
 // RUN: clang-cc -fsyntax-only -verify %s
-// XFAIL
 // PR4794
 
 template <class T> class X





More information about the cfe-commits mailing list