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.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp
index 0d42689833..37c654d666 100644
--- a/lib/AST/MicrosoftMangle.cpp
+++ b/lib/AST/MicrosoftMangle.cpp
@@ -706,8 +706,15 @@ void MicrosoftCXXNameMangler::mangleTemplateInstantiationName(
// <template-name> ::= <unscoped-template-name> <template-args>
// ::= <substitution>
// Always start with the unqualified name.
+
+ // Templates have their own context for back references.
+ BackRefMap TemplateContext;
+ NameBackReferences.swap(TemplateContext);
+
mangleUnscopedTemplateName(TD);
mangleTemplateArgs(TemplateArgs);
+
+ NameBackReferences.swap(TemplateContext);
}
void