This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/48424] New: C++0x parameter packs expansion problem
- From: "aiedail92 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 3 Apr 2011 13:42:42 +0000
- Subject: [Bug c++/48424] New: C++0x parameter packs expansion problem
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48424
Summary: C++0x parameter packs expansion problem
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: aiedail92@gmail.com
The following testcase, which should be valid (at least I think so), fails to
compile:
#include <tuple>
#include <functional>
template<typename... T>
struct test
{
std::tuple<int, T..., long> t; // OK
void(*fptr)(int, T..., long); // Error (1)
std::function<void(int, T..., long)> f; // Error (2)
};
Since in (1) and (2) T... is not a parameter pack declaration, but a parameter
pack expansion, shouldn't the code be valid? And if it's really not valid, is
there a good explanation for this?
luca@laptop-luca:~$ g++ --version
g++ (GCC) 4.7.0 20110330 (experimental)
luca@laptop-luca:~$ g++ -std=c++0x testcase.cc
testcase.cc:8:32: error: parameter packs must be at the end of the parameter
list
testcase.cc:9:39: error: parameter packs must be at the end of the parameter
list