diff options
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiate.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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)); |