diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-04-22 22:25:37 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-04-22 22:25:37 +0000 |
commit | 975096917843e32ad4d27e8c52204c94b864689e (patch) | |
tree | 488ee60e2003d7efb8235a9652bd2bd01342d4ae /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 1c229c0472edfd59ce61ba063a93517df609ceb4 (diff) | |
download | bcm5719-llvm-975096917843e32ad4d27e8c52204c94b864689e.tar.gz bcm5719-llvm-975096917843e32ad4d27e8c52204c94b864689e.zip |
At the end of the translation unit, defining a vtable can introduce
new templates that need to be instantiated and vice-versa. Iterate
until we've instantiated all required templates and defined all
required vtables. Fixed PR9325 / <rdar://problem/9055177>.
llvm-svn: 130023
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 588501f50ed..c972c6602e1 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -3109,7 +3109,10 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D, /// \brief Performs template instantiation for all implicit template /// instantiations we have seen until this point. -void Sema::PerformPendingInstantiations(bool LocalOnly) { +/// +/// \returns true if anything was instantiated. +bool Sema::PerformPendingInstantiations(bool LocalOnly) { + bool InstantiatedAnything = false; while (!PendingLocalImplicitInstantiations.empty() || (!LocalOnly && !PendingInstantiations.empty())) { PendingImplicitInstantiation Inst; @@ -3130,6 +3133,7 @@ void Sema::PerformPendingInstantiations(bool LocalOnly) { TSK_ExplicitInstantiationDefinition; InstantiateFunctionDefinition(/*FIXME:*/Inst.second, Function, true, DefinitionRequired); + InstantiatedAnything = true; continue; } @@ -3166,7 +3170,10 @@ void Sema::PerformPendingInstantiations(bool LocalOnly) { TSK_ExplicitInstantiationDefinition; InstantiateStaticDataMemberDefinition(/*FIXME:*/Inst.second, Var, true, DefinitionRequired); + InstantiatedAnything = true; } + + return InstantiatedAnything; } void Sema::PerformDependentDiagnostics(const DeclContext *Pattern, |