From: Nick Lewycky Date: Sat, 30 Oct 2010 06:48:20 +0000 (+0000) Subject: Preserve the template type parameter name when instantiating a templace. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=61139c561f1a2c872209e32ff9143487cebf4324;p=clang Preserve the template type parameter name when instantiating a templace. Fixes PR8489. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117776 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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::Y::Z<0,int>(); } } + +namespace PR8489 { + template + class C { + template + void F() {} // expected-note{{FT}} + }; + void f() { + C c; + c.F(); // expected-error{{no matching member function}} + } +}