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: [email protected]
ReportedBy: [email protected]
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