diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-10-27 06:26:26 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-10-27 06:26:26 +0000 |
commit | ef6ab417c18fe68ae1f90d8a4d874f3cec90347b (patch) | |
tree | 7b8bcffec767ed0e94884a9984fb194b355b1baa /clang/lib/Sema/SemaTemplate.cpp | |
parent | d169e6c28115e1e61b61cd656b3bf8b44c8531de (diff) | |
download | bcm5719-llvm-ef6ab417c18fe68ae1f90d8a4d874f3cec90347b.tar.gz bcm5719-llvm-ef6ab417c18fe68ae1f90d8a4d874f3cec90347b.zip |
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.
llvm-svn: 85209
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 2bb790dda4e..4419ad04a25 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/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). /// |