r256623 - [MS ABI] Add variable templates to the NameBackReferences
David Majnemer via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 29 21:40:32 PST 2015
Author: majnemer
Date: Tue Dec 29 23:40:32 2015
New Revision: 256623
URL: http://llvm.org/viewvc/llvm-project?rev=256623&view=rev
Log:
[MS ABI] Add variable templates to the NameBackReferences
Only function template specializations are exempt from being added to
the NameBackReferences. Redundant variable template specializations
should be appropriately substituted.
Modified:
cfe/trunk/lib/AST/MicrosoftMangle.cpp
cfe/trunk/test/CodeGenCXX/mangle-ms-cxx14.cpp
Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=256623&r1=256622&r2=256623&view=diff
==============================================================================
--- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Tue Dec 29 23:40:32 2015
@@ -698,7 +698,7 @@ void MicrosoftCXXNameMangler::mangleUnqu
// Function templates aren't considered for name back referencing. This
// makes sense since function templates aren't likely to occur multiple
// times in a symbol.
- if (!isa<ClassTemplateDecl>(TD)) {
+ if (isa<FunctionTemplateDecl>(TD)) {
mangleTemplateInstantiationName(TD, *TemplateArgs);
Out << '@';
return;
Modified: cfe/trunk/test/CodeGenCXX/mangle-ms-cxx14.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-ms-cxx14.cpp?rev=256623&r1=256622&r2=256623&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-ms-cxx14.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-ms-cxx14.cpp Tue Dec 29 23:40:32 2015
@@ -49,3 +49,9 @@ int WithPMD = 0;
template <> int WithPMD<nullptr>;
// CHECK-DAG: "\01??$WithPMD@$GA at A@?0@@3HA"
+
+template <const int *, const int *>
+struct Foo {};
+
+Foo<&x<int>, &x<int>> Zoo;
+// CHECK-DAG: "\01?Zoo@@3U?$Foo@$1??$x at H@@3HA$1?1 at 3HA@@A"
More information about the cfe-commits
mailing list