[cfe-commits] r124863 - in /cfe/trunk: lib/Sema/SemaDecl.cpp lib/Sema/SemaTemplate.cpp test/CXX/temp/temp.param/p9-0x.cpp

Douglas Gregor dgregor at apple.com
Fri Feb 4 04:22:54 PST 2011


Author: dgregor
Date: Fri Feb  4 06:22:53 2011
New Revision: 124863

URL: http://llvm.org/viewvc/llvm-project?rev=124863&view=rev
Log:
Tweak my fix for PR8748, and update the incorrect PR number in the test case.

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/lib/Sema/SemaTemplate.cpp
    cfe/trunk/test/CXX/temp/temp.param/p9-0x.cpp

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=124863&r1=124862&r2=124863&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Fri Feb  4 06:22:53 2011
@@ -3972,7 +3972,8 @@
                                    ? TPC_FriendFunctionTemplateDefinition
                                    : TPC_FriendFunctionTemplate)
                               : (D.getCXXScopeSpec().isSet() && 
-                                 DC && DC->isRecord())
+                                 DC && DC->isRecord() && 
+                                 DC->isDependentContext())
                                   ? TPC_ClassTemplateMember
                                   : TPC_FunctionTemplate);
     }

Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=124863&r1=124862&r2=124863&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp Fri Feb  4 06:22:53 2011
@@ -947,7 +947,8 @@
   if (CheckTemplateParameterList(TemplateParams,
             PrevClassTemplate? PrevClassTemplate->getTemplateParameters() : 0,
                                  (SS.isSet() && SemanticContext &&
-                                  SemanticContext->isRecord())
+                                  SemanticContext->isRecord() &&
+                                  SemanticContext->isDependentContext())
                                    ? TPC_ClassTemplateMember
                                    : TPC_ClassTemplate))
     Invalid = true;

Modified: cfe/trunk/test/CXX/temp/temp.param/p9-0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.param/p9-0x.cpp?rev=124863&r1=124862&r2=124863&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.param/p9-0x.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.param/p9-0x.cpp Fri Feb  4 06:22:53 2011
@@ -22,10 +22,10 @@
   }
 };
 
-namespace PR8747 {
+namespace PR8748 {
   // Testcase 1
   struct A0 { template<typename U> struct B; }; 
-  template<typename U = int> struct A0::B { }; // expected-error{{cannot add a default template argument to the definition of a member of a class template}}
+  template<typename U = int> struct A0::B { };
   
   // Testcase 2
   template<typename T> struct A1 { template<typename U> struct B; }; 





More information about the cfe-commits mailing list