This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47226] New: GCC doesn't expand template parameter pack that appears in a lambda-expression
- From: "schaub.johannes at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 8 Jan 2011 20:58:59 +0000
- Subject: [Bug c++/47226] New: GCC doesn't expand template parameter pack that appears in a lambda-expression
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47226
Summary: GCC doesn't expand template parameter pack that
appears in a lambda-expression
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: schaub.johannes@googlemail.com
GCC doesn't like this:
void slurp(...) { }
template<int ...N>
void print() {
slurp([]() -> int {
(void) N; // or something fancy...
return 0;
}() ...);
}
void f() { print<1, 2>(); }
Error:
error: parameter packs not expanded with '...':
I think the draft (n3225) says this should expand "N" and result in:
slurp(
[]() -> int {
(void) 1; // or something fancy...
return 0;
}(),
[]() -> int {
(void) 2; // or something fancy...
return 0;
}());