From: Douglas Gregor Date: Thu, 8 Oct 2009 01:19:17 +0000 (+0000) Subject: Make sure to set the template specialization kind of an explicit X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e9374d5e2c0915bd883dfa988db2451b844390d8;p=clang Make sure to set the template specialization kind of an explicit template instantiation of a member function of a class template. FIXME -= 2; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83520 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 339a084d7a..9d3efa60b0 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -3651,11 +3651,6 @@ Sema::DeclResult Sema::ActOnExplicitInstantiation(Scope *S, InstantiateFunctionDefinition(D.getIdentifierLoc(), Specialization, false); - // FIXME: setTemplateSpecializationKind doesn't (yet) work for - // non-templated member functions. - if (!Specialization->getPrimaryTemplate()) - break; - Specialization->setTemplateSpecializationKind(TSK); break; } diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index e0ffca9d2d..ee6600adc6 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -996,9 +996,9 @@ Sema::InstantiateClassMembers(SourceLocation PointOfInstantiation, Record->getInstantiatedFromMemberClass(), TemplateArgs, TSK); - else - InstantiateClassMembers(PointOfInstantiation, Record, TemplateArgs, - TSK); + + InstantiateClassMembers(PointOfInstantiation, Record, TemplateArgs, + TSK); } } } diff --git a/test/SemaTemplate/extern-templates.cpp b/test/SemaTemplate/extern-templates.cpp index 7154c7e32f..28fda1a11e 100644 --- a/test/SemaTemplate/extern-templates.cpp +++ b/test/SemaTemplate/extern-templates.cpp @@ -62,6 +62,5 @@ void g_X1(X1 x1, void *ptr) { extern template void X1::g(const void*); void g_X1_2(X1 x1, const void *ptr) { - // FIXME: This should not instantiate of x1::g -// x1.g(ptr); + x1.g(ptr); }