aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/MicrosoftMangle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/MicrosoftMangle.cpp')
-rw-r--r--lib/AST/MicrosoftMangle.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp
index d91f512538..afb8bf8844 100644
--- a/lib/AST/MicrosoftMangle.cpp
+++ b/lib/AST/MicrosoftMangle.cpp
@@ -742,13 +742,17 @@ void MicrosoftCXXNameMangler::mangleTemplateInstantiationName(
// Always start with the unqualified name.
// Templates have their own context for back references.
- BackRefMap TemplateContext;
- NameBackReferences.swap(TemplateContext);
+ ArgBackRefMap OuterArgsContext;
+ BackRefMap OuterTemplateContext;
+ NameBackReferences.swap(OuterTemplateContext);
+ TypeBackReferences.swap(OuterArgsContext);
mangleUnscopedTemplateName(TD);
mangleTemplateArgs(TemplateArgs);
- NameBackReferences.swap(TemplateContext);
+ // Restore the previous back reference contexts.
+ NameBackReferences.swap(OuterTemplateContext);
+ TypeBackReferences.swap(OuterArgsContext);
}
void