summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp3
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiate.cpp6
2 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 2e5e34d7f89..62bcabc2903 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -11774,9 +11774,6 @@ static void RebuildLambdaScopeInfo(CXXMethodDecl *CallOperator,
Decl *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Decl *D,
SkipBodyInfo *SkipBody) {
- // Clear the last template instantiation error context.
- LastTemplateInstantiationErrorContext = CodeSynthesisContext();
-
if (!D)
return D;
FunctionDecl *FD = nullptr;
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index 94e79f5c50d..7b09b77da32 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -369,6 +369,12 @@ void Sema::InstantiatingTemplate::Clear() {
SemaRef.CodeSynthesisContextLookupModules.pop_back();
}
+ // If we've left the code synthesis context for the current context stack,
+ // stop remembering that we've emitted that stack.
+ if (SemaRef.CodeSynthesisContexts.size() ==
+ SemaRef.LastEmittedCodeSynthesisContextDepth)
+ SemaRef.LastEmittedCodeSynthesisContextDepth = 0;
+
if (!AlreadyInstantiating)
SemaRef.InstantiatingSpecializations.erase(
std::make_pair(Active.Entity, Active.Kind));
OpenPOWER on IntegriCloud