aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-10-27 06:26:26 +0000
committerDouglas Gregor <dgregor@apple.com>2009-10-27 06:26:26 +0000
commit972e6ce33c7e307f4b0da12bd6079bbd6ef76948 (patch)
treef41ba0ba00f71fac8ed72f642bdfb8741b891b54 /lib/Sema/SemaTemplate.cpp
parent9a4c1055fcf5b7d56a4549925a022089d086becb (diff)
Only set the point of instantiation for an implicit or explicit
instantiation once we have committed to performing the instantiation. As part of this, make our makeshift template-instantiation location information suck slightly less. Fixes PR5264. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85209 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 2bb790dda4..4419ad04a2 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -3726,8 +3726,6 @@ Sema::ActOnExplicitInstantiation(Scope *S,
Specialization->setLexicalDeclContext(CurContext);
CurContext->addDecl(Specialization);
- Specialization->setPointOfInstantiation(TemplateNameLoc);
-
// C++ [temp.explicit]p3:
// A definition of a class template or class member template
// shall be in scope at the point of the explicit instantiation of
@@ -3739,7 +3737,7 @@ Sema::ActOnExplicitInstantiation(Scope *S,
= cast_or_null<ClassTemplateSpecializationDecl>(
Specialization->getDefinition(Context));
if (!Def)
- InstantiateClassTemplateSpecialization(Specialization, TSK);
+ InstantiateClassTemplateSpecialization(TemplateNameLoc, Specialization, TSK);
else // Instantiate the members of this class template specialization.
InstantiateClassTemplateSpecializationMembers(TemplateNameLoc, Def, TSK);
@@ -4280,6 +4278,13 @@ namespace {
/// \brief Returns the name of the entity whose type is being rebuilt.
DeclarationName getBaseEntity() { return Entity; }
+ /// \brief Sets the "base" location and entity when that
+ /// information is known based on another transformation.
+ void setBase(SourceLocation Loc, DeclarationName Entity) {
+ this->Loc = Loc;
+ this->Entity = Entity;
+ }
+
/// \brief Transforms an expression by returning the expression itself
/// (an identity function).
///