From: John McCall Date: Tue, 17 Aug 2010 21:51:21 +0000 (+0000) Subject: Whoops. Don't fall through into the overload case when mangling a X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f615bc52bd5513019c32b378834a3c1b8425bf8;p=clang Whoops. Don't fall through into the overload case when mangling a dependent call expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111300 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp index 7bdbabc8c0..969670a28d 100644 --- a/lib/CodeGen/Mangle.cpp +++ b/lib/CodeGen/Mangle.cpp @@ -1546,8 +1546,8 @@ void CXXNameMangler::mangleIntegerLiteral(QualType T, void CXXNameMangler::mangleCalledExpression(const Expr *E, unsigned Arity) { if (E->getType() != getASTContext().OverloadTy) - mangleExpression(E); - // propagate arity to dependent overloads? + return mangleExpression(E); + // FIXME: propagate arity to dependent overloads? llvm::PointerIntPair R = OverloadExpr::find(const_cast(E)); diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp index 4152dabc0b..6636c926ae 100644 --- a/test/CodeGenCXX/mangle.cpp +++ b/test/CodeGenCXX/mangle.cpp @@ -540,3 +540,20 @@ namespace test16 { static union { struct { union {}; }; }; static union { struct { struct {}; }; }; } + +// rdar://problem/8302148 +namespace test17 { + template struct A {}; + + struct B { + static int foo(void); + }; + + template A func(void); + + // CHECK: define i32 @_ZN6test174testEv() + // CHECK: call {{.*}} @_ZN6test174funcINS_1BEEENS_1AIXszclsrT_3fooEEEEv() + int test() { + func(); // { dg-error "sorry, unimplemented" } + } +}