[cfe-commits] r83520 - in /cfe/trunk: lib/Sema/SemaTemplate.cpp lib/Sema/SemaTemplateInstantiate.cpp test/SemaTemplate/extern-templates.cpp

Douglas Gregor dgregor at apple.com
Wed Oct 7 18:19:17 PDT 2009


Author: dgregor
Date: Wed Oct  7 20:19:17 2009
New Revision: 83520

URL: http://llvm.org/viewvc/llvm-project?rev=83520&view=rev
Log:
Make sure to set the template specialization kind of an explicit
template instantiation of a member function of a class template.
FIXME -= 2;

Modified:
    cfe/trunk/lib/Sema/SemaTemplate.cpp
    cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
    cfe/trunk/test/SemaTemplate/extern-templates.cpp

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp Wed Oct  7 20:19:17 2009
@@ -3651,11 +3651,6 @@
       InstantiateFunctionDefinition(D.getIdentifierLoc(), Specialization, 
                                     false);
       
-    // FIXME: setTemplateSpecializationKind doesn't (yet) work for 
-    // non-templated member functions.
-    if (!Specialization->getPrimaryTemplate())
-      break;
-      
     Specialization->setTemplateSpecializationKind(TSK);
     break;
   }

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp Wed Oct  7 20:19:17 2009
@@ -996,9 +996,9 @@
                          Record->getInstantiatedFromMemberClass(),
                          TemplateArgs,
                          TSK);
-      else
-        InstantiateClassMembers(PointOfInstantiation, Record, TemplateArgs, 
-                                TSK);
+      
+      InstantiateClassMembers(PointOfInstantiation, Record, TemplateArgs, 
+                              TSK);
     }
   }
 }

Modified: cfe/trunk/test/SemaTemplate/extern-templates.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/extern-templates.cpp?rev=83520&r1=83519&r2=83520&view=diff

==============================================================================
--- cfe/trunk/test/SemaTemplate/extern-templates.cpp (original)
+++ cfe/trunk/test/SemaTemplate/extern-templates.cpp Wed Oct  7 20:19:17 2009
@@ -62,6 +62,5 @@
 extern template void X1<const void*>::g(const void*);
 
 void g_X1_2(X1<const void *> x1, const void *ptr) {
-  // FIXME: This should not instantiate of x1<const void*>::g
-//  x1.g(ptr);
+  x1.g(ptr);
 }





More information about the cfe-commits mailing list