forked from OSchip/llvm-project
GCC seems to create address-of expression manglings when passing *any*
function as a template argument where a pointer to function is wanted. Just extend the existing hack. llvm-svn: 130084
This commit is contained in:
parent
6dc0a2b467
commit
617339e692
|
@ -2458,8 +2458,7 @@ void CXXNameMangler::mangleTemplateArg(const NamedDecl *P,
|
||||||
// an expression. We compensate for it here to produce the correct mangling.
|
// an expression. We compensate for it here to produce the correct mangling.
|
||||||
NamedDecl *D = cast<NamedDecl>(A.getAsDecl());
|
NamedDecl *D = cast<NamedDecl>(A.getAsDecl());
|
||||||
const NonTypeTemplateParmDecl *Parameter = cast<NonTypeTemplateParmDecl>(P);
|
const NonTypeTemplateParmDecl *Parameter = cast<NonTypeTemplateParmDecl>(P);
|
||||||
bool compensateMangling = D->isCXXClassMember() &&
|
bool compensateMangling = !Parameter->getType()->isReferenceType();
|
||||||
!Parameter->getType()->isReferenceType();
|
|
||||||
if (compensateMangling) {
|
if (compensateMangling) {
|
||||||
Out << 'X';
|
Out << 'X';
|
||||||
mangleOperatorName(OO_Amp, 1);
|
mangleOperatorName(OO_Amp, 1);
|
||||||
|
|
|
@ -664,3 +664,15 @@ namespace test24 {
|
||||||
foo();
|
foo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// rdar://problem/8806641
|
||||||
|
namespace test25 {
|
||||||
|
template <void (*fn)()> struct A {
|
||||||
|
static void call() { fn(); }
|
||||||
|
};
|
||||||
|
void foo();
|
||||||
|
void test() {
|
||||||
|
// CHECK: call void @_ZN6test251AIXadL_ZNS_3fooEvEEE4callEv()
|
||||||
|
A<foo>::call();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue