Preserve the template type parameter name when instantiating a templace.

Fixes PR8489.

llvm-svn: 117776
This commit is contained in:
Nick Lewycky 2010-10-30 06:48:20 +00:00
parent 5c0b40528d
commit b9b3927356
2 changed files with 13 additions and 1 deletions

View 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());

View 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}}
}
}