diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2010-08-25 08:27:02 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2010-08-25 08:27:02 +0000 |
commit | 58e390ef491c8fb11ae17445054ee09527b492d3 (patch) | |
tree | 4feae5dcb201c19aacc92fa153bed7092f981bc7 /lib/Sema/SemaTemplate.cpp | |
parent | 384aff8b94bb0d1ad6c5667b90621e5699815bb2 (diff) |
Support explicit instantiation of function templates and members of class
templates when only the declaration is in scope. This requires deferring the
instantiation to be lazy, and ensuring the definition is required for that
translation unit. We re-use the existing pending instantiation queue,
previously only used to track implicit instantiations which were required to be
lazy. Fixes PR7979.
A subsequent change will rename *PendingImplicitInstantiations to
*PendingInstatiations for clarity given its broader role.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112037 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 8826b7f370..e7c506810d 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -5071,8 +5071,7 @@ Sema::DeclResult Sema::ActOnExplicitInstantiation(Scope *S, // Instantiate static data member. Prev->setTemplateSpecializationKind(TSK, D.getIdentifierLoc()); if (TSK == TSK_ExplicitInstantiationDefinition) - InstantiateStaticDataMemberDefinition(D.getIdentifierLoc(), Prev, false, - /*DefinitionRequired=*/true); + InstantiateStaticDataMemberDefinition(D.getIdentifierLoc(), Prev); // FIXME: Create an ExplicitInstantiation node? return (Decl*) 0; @@ -5179,8 +5178,7 @@ Sema::DeclResult Sema::ActOnExplicitInstantiation(Scope *S, Specialization->setTemplateSpecializationKind(TSK, D.getIdentifierLoc()); if (TSK == TSK_ExplicitInstantiationDefinition) - InstantiateFunctionDefinition(D.getIdentifierLoc(), Specialization, - false, /*DefinitionRequired=*/true); + InstantiateFunctionDefinition(D.getIdentifierLoc(), Specialization); // C++0x [temp.explicit]p2: // If the explicit instantiation is for a member function, a member class |