Summary:
Properly mangle declarations showing up in template arguments that are
reference parameters. Fun-fact: undname cannot handle these!
Reviewers: rnk, cdavis5x
Reviewed By: rnk
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1356
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188245
91177308-0d34-0410-b5e6-
96231b3b80d8
mangleType(T, SourceRange(), QMM_Escape);
break;
}
- case TemplateArgument::Declaration:
- mangle(cast<NamedDecl>(TA.getAsDecl()), "$1?");
+ case TemplateArgument::Declaration: {
+ const NamedDecl *ND = cast<NamedDecl>(TA.getAsDecl());
+ mangle(ND, TA.isDeclForReferenceParam() ? "$E?" : "$1?");
break;
+ }
case TemplateArgument::Integral:
mangleIntegerLiteral(TA.getAsIntegral(),
TA.getIntegralType()->isBooleanType());
template <decltype(nullptr)> struct S1 {};
void f(S1<nullptr>) {}
// CHECK: "\01?f@@YAXU?$S1@$0A@@@@Z"
+
+struct record {
+ int first;
+ int second;
+};
+template <const record &>
+struct type1 {
+};
+extern const record inst;
+void recref(type1<inst>) {}
+// CHECK: "\01?recref@@YAXU?$type1@$E?inst@@3Urecord@@B@@@Z"