Itanium ABI: Pack expansions change the arity of expressions to unknown

llvm-svn: 229918
This commit is contained in:
David Majnemer 2015-02-19 21:41:48 +00:00
parent cbdbf39881
commit 67a8ec6258
2 changed files with 17 additions and 3 deletions

View File

@ -2796,9 +2796,14 @@ recurse:
Out << "cl";
}
mangleExpression(CE->getCallee(), CE->getNumArgs());
for (unsigned I = 0, N = CE->getNumArgs(); I != N; ++I)
mangleExpression(CE->getArg(I));
unsigned CallArity = CE->getNumArgs();
for (const Expr *Arg : CE->arguments())
if (isa<PackExpansionExpr>(Arg))
CallArity = UnknownArity;
mangleExpression(CE->getCallee(), CallArity);
for (const Expr *Arg : CE->arguments())
mangleExpression(Arg);
Out << 'E';
break;
}

View File

@ -1062,3 +1062,12 @@ namespace test51 {
// CHECK-LABEL: @_ZN6test514fun7INS_1EEEEDTcldtcvS1__Esr1EEdnT_EEv
template void fun8<X>();
}
namespace test52 {
struct X {};
void operator+(X);
template <typename... T>
auto f4(T... x) -> decltype(operator+(x...));
// CHECK-LABEL: @_ZN6test522f4IJNS_1XEEEEDTclonplspfp_EEDpT_
void use() { f4(X{}); }
}