[cfe-commits] r134974 - in /cfe/trunk: lib/AST/ItaniumMangle.cpp test/CodeGenCXX/mangle.cpp
Douglas Gregor
dgregor at apple.com
Tue Jul 12 00:03:48 PDT 2011
Author: dgregor
Date: Tue Jul 12 02:03:48 2011
New Revision: 134974
URL: http://llvm.org/viewvc/llvm-project?rev=134974&view=rev
Log:
Implement name mangling for sizeof...(function parameter pack).
Modified:
cfe/trunk/lib/AST/ItaniumMangle.cpp
cfe/trunk/test/CodeGenCXX/mangle.cpp
Modified: cfe/trunk/lib/AST/ItaniumMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ItaniumMangle.cpp?rev=134974&r1=134973&r2=134974&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ItaniumMangle.cpp (original)
+++ cfe/trunk/lib/AST/ItaniumMangle.cpp Tue Jul 12 02:03:48 2011
@@ -2669,15 +2669,8 @@
else if (const TemplateTemplateParmDecl *TempTP
= dyn_cast<TemplateTemplateParmDecl>(Pack))
mangleTemplateParameter(TempTP->getIndex());
- else {
- // Note: proposed by Mike Herrick on 11/30/10
- // <expression> ::= sZ <function-param> # 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<ParmVarDecl>(Pack));
break;
}
Modified: cfe/trunk/test/CodeGenCXX/mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle.cpp?rev=134974&r1=134973&r2=134974&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle.cpp Tue Jul 12 02:03:48 2011
@@ -839,3 +839,13 @@
// CHECK: define weak_odr void @_ZN6test352f1INS_1AEEEvDTszadsrT_plIiEE
template void f1<A>(__SIZE_TYPE__);
}
+
+namespace test36 {
+ template<unsigned> struct A { };
+
+ template<typename ...Types>
+ auto f1(Types... values) -> A<sizeof...(values)> { }
+
+ // CHECK: define weak_odr {{.*}} @_ZN6test362f1IJifEEENS_1AIXsZfp_EEEDpT_
+ template A<2> f1(int, float);
+}
More information about the cfe-commits
mailing list