summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2018-03-26 18:22:47 +0000
committerReid Kleckner <rnk@google.com>2018-03-26 18:22:47 +0000
commit24bd88c0b06595a9e60d8a4f710bf17f0baac356 (patch)
treebf6d47d9b5b6f3edddfe2c6554953d6bb5efd2c6 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
parentf33d9052935869fb2b70272b41de5b5df610c958 (diff)
downloadbcm5719-llvm-24bd88c0b06595a9e60d8a4f710bf17f0baac356.tar.gz
bcm5719-llvm-24bd88c0b06595a9e60d8a4f710bf17f0baac356.zip
[MS] Fix late-parsed template infinite loop in eager instantiation
Summary: This fixes PR33561 and PR34185. Don't store pending template instantiations for late-parsed templates in the normal PendingInstantiations queue. Instead, use a separate list that will only be parsed and instantiated at end of TU when late template parsing actually works and doesn't infinite loop. Reviewers: rsmith, thakis, hans Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D44846 llvm-svn: 328567
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index ebfad36d365..9e09a6aa356 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -3837,8 +3837,8 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
if (PatternDecl->isLateTemplateParsed() &&
!LateTemplateParser) {
Function->setInstantiationIsPending(true);
- PendingInstantiations.push_back(
- std::make_pair(Function, PointOfInstantiation));
+ LateParsedInstantiations.push_back(
+ std::make_pair(Function, PointOfInstantiation));
return;
}
OpenPOWER on IntegriCloud