summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/MicrosoftMangle.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-03-18 03:56:27 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-03-18 03:56:27 +0000
commit4deaac780c9e84aeb46fa9d4ce75870d95f6e436 (patch)
tree7a167da148cef1270caa027fa48b844c0a114a82 /clang/lib/AST/MicrosoftMangle.cpp
parent2ae0a1eafc1133b00580656f107cc976d3cb422a (diff)
downloadbcm5719-llvm-4deaac780c9e84aeb46fa9d4ce75870d95f6e436.tar.gz
bcm5719-llvm-4deaac780c9e84aeb46fa9d4ce75870d95f6e436.zip
MS ABI: Empty pack expansions had their mangling changed in 2013->2015
We used to support the 2013 mangling and changed it to the more reasonable 2015 mangling. Let's make the mangling conditional on what version of MSVC is targeted. This fixes PR21888. llvm-svn: 232609
Diffstat (limited to 'clang/lib/AST/MicrosoftMangle.cpp')
-rw-r--r--clang/lib/AST/MicrosoftMangle.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp
index b8dd72f5e3d..563ea7ffc86 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/lib/AST/MicrosoftMangle.cpp
@@ -1203,7 +1203,11 @@ void MicrosoftCXXNameMangler::mangleTemplateArg(const TemplateDecl *TD,
if (TemplateArgs.empty()) {
if (isa<TemplateTypeParmDecl>(Parm) ||
isa<TemplateTemplateParmDecl>(Parm))
- Out << "$$V";
+ // MSVC 2015 changed the mangling for empty expanded template packs,
+ // use the old mangling for link compatibility for old versions.
+ Out << (Context.getASTContext().getLangOpts().isCompatibleWithMSVC(19)
+ ? "$$V"
+ : "$$$V");
else if (isa<NonTypeTemplateParmDecl>(Parm))
Out << "$S";
else
OpenPOWER on IntegriCloud