[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.

llvm-svn: 256623
This commit is contained in:
David Majnemer 2015-12-30 05:40:32 +00:00
parent 5f177620c3
commit 56e2adb6fd
2 changed files with 7 additions and 1 deletions

View File

@ -698,7 +698,7 @@ void MicrosoftCXXNameMangler::mangleUnqualifiedName(const NamedDecl *ND,
// 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;

View File

@ -49,3 +49,9 @@ int WithPMD = 0;
template <> int WithPMD<nullptr>;
// CHECK-DAG: "\01??$WithPMD@$GA@A@?0@@3HA"
template <const int *, const int *>
struct Foo {};
Foo<&x<int>, &x<int>> Zoo;
// CHECK-DAG: "\01?Zoo@@3U?$Foo@$1??$x@H@@3HA$1?1@3HA@@A"