From: Douglas Gregor Date: Tue, 12 Jul 2011 07:03:48 +0000 (+0000) Subject: Implement name mangling for sizeof...(function parameter pack). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91832368ef1c1158c4351bdccaa141dac818f04e;p=clang Implement name mangling for sizeof...(function parameter pack). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134974 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp index 5a1025fff0..5b247f2cdd 100644 --- a/lib/AST/ItaniumMangle.cpp +++ b/lib/AST/ItaniumMangle.cpp @@ -2669,15 +2669,8 @@ recurse: else if (const TemplateTemplateParmDecl *TempTP = dyn_cast(Pack)) mangleTemplateParameter(TempTP->getIndex()); - else { - // Note: proposed by Mike Herrick on 11/30/10 - // ::= sZ # size of function parameter pack - Diagnostic &Diags = Context.getDiags(); - unsigned DiagID = Diags.getCustomDiagID(Diagnostic::Error, - "cannot mangle sizeof...(function parameter pack)"); - Diags.Report(DiagID); - return; - } + else + mangleFunctionParam(cast(Pack)); break; } diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp index 0f4e5c5c38..0b3ba639af 100644 --- a/test/CodeGenCXX/mangle.cpp +++ b/test/CodeGenCXX/mangle.cpp @@ -839,3 +839,13 @@ namespace test35 { // CHECK: define weak_odr void @_ZN6test352f1INS_1AEEEvDTszadsrT_plIiEE template void f1(__SIZE_TYPE__); } + +namespace test36 { + template struct A { }; + + template + auto f1(Types... values) -> A { } + + // CHECK: define weak_odr {{.*}} @_ZN6test362f1IJifEEENS_1AIXsZfp_EEEDpT_ + template A<2> f1(int, float); +}