From 26d6e9d56527b6b52c44b892aed3171a27d98eb6 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Tue, 24 Nov 2009 05:34:41 +0000 Subject: [PATCH] Set the template specialization kind before instantiating the function definition so that the function will have the right linkage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89740 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaTemplate.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index bfdf17afae..a37a73119d 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -4347,12 +4347,12 @@ Sema::DeclResult Sema::ActOnExplicitInstantiation(Scope *S, if (SuppressNew) return DeclPtrTy(); } + + Specialization->setTemplateSpecializationKind(TSK, D.getIdentifierLoc()); if (TSK == TSK_ExplicitInstantiationDefinition) InstantiateFunctionDefinition(D.getIdentifierLoc(), Specialization, false, /*DefinitionRequired=*/true); - - Specialization->setTemplateSpecializationKind(TSK, D.getIdentifierLoc()); // C++0x [temp.explicit]p2: // If the explicit instantiation is for a member function, a member class -- 2.40.0