aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp2
-rw-r--r--test/SemaTemplate/instantiate-member-template.cpp12
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 1dbdefca9f..6e352e71ef 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -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());
diff --git a/test/SemaTemplate/instantiate-member-template.cpp b/test/SemaTemplate/instantiate-member-template.cpp
index 8f4063bc71..e2f7275618 100644
--- a/test/SemaTemplate/instantiate-member-template.cpp
+++ b/test/SemaTemplate/instantiate-member-template.cpp
@@ -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}}
+ }
+}