[cfe-commits] r117776 - in /cfe/trunk: lib/Sema/SemaTemplateInstantiateDecl.cpp test/SemaTemplate/instantiate-member-template.cpp

Nick Lewycky nicholas at mxc.ca
Fri Oct 29 23:48:20 PDT 2010


Author: nicholas
Date: Sat Oct 30 01:48:20 2010
New Revision: 117776

URL: http://llvm.org/viewvc/llvm-project?rev=117776&view=rev
Log:
Preserve the template type parameter name when instantiating a templace.
Fixes PR8489.

Modified:
    cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
    cfe/trunk/test/SemaTemplate/instantiate-member-template.cpp

Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=117776&r1=117775&r2=117776&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Sat Oct 30 01:48:20 2010
@@ -1508,7 +1508,7 @@
   TemplateTypeParmDecl *Inst =
     TemplateTypeParmDecl::Create(SemaRef.Context, Owner, D->getLocation(),
                                  TTPT->getDepth() - TemplateArgs.getNumLevels(),
-                                 TTPT->getIndex(),TTPT->getName(),
+                                 TTPT->getIndex(), D->getIdentifier(),
                                  D->wasDeclaredWithTypename(),
                                  D->isParameterPack());
 

Modified: cfe/trunk/test/SemaTemplate/instantiate-member-template.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-member-template.cpp?rev=117776&r1=117775&r2=117776&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/instantiate-member-template.cpp (original)
+++ cfe/trunk/test/SemaTemplate/instantiate-member-template.cpp Sat Oct 30 01:48:20 2010
@@ -203,3 +203,15 @@
     X<int>::Y<int>::Z<0,int>();
   }
 }
+
+namespace PR8489 {
+  template <typename CT>
+  class C {
+    template<typename FT>
+    void F() {} // expected-note{{FT}}
+  };
+  void f() {
+    C<int> c;
+    c.F(); // expected-error{{no matching member function}}
+  }
+}





More information about the cfe-commits mailing list