]> granicus.if.org Git - clang/commitdiff
Preserve the template type parameter name when instantiating a templace.
authorNick Lewycky <nicholas@mxc.ca>
Sat, 30 Oct 2010 06:48:20 +0000 (06:48 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Sat, 30 Oct 2010 06:48:20 +0000 (06:48 +0000)
Fixes PR8489.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117776 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaTemplateInstantiateDecl.cpp
test/SemaTemplate/instantiate-member-template.cpp

index 1dbdefca9fc972db3a282785080be449a05af0b5..6e352e71ef6531aa250b4aad940a24931b99597d 100644 (file)
@@ -1508,7 +1508,7 @@ Decl *TemplateDeclInstantiator::VisitTemplateTypeParmDecl(
   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());
 
index 8f4063bc71cb6e1111866efe69d6b7e8d56772dc..e2f72756189cc1afec1ac879e32f0e77b0609e87 100644 (file)
@@ -203,3 +203,15 @@ namespace PR7669 {
     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}}
+  }
+}