[Bug c++/59716] New: variadic template multiple parameter pack expansion fails
lts-rudolph at gmx dot de
gcc-bugzilla@gcc.gnu.org
Wed Jan 8 07:15:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59716
Bug ID: 59716
Summary: variadic template multiple parameter pack expansion
fails
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: lts-rudolph at gmx dot de
Created attachment 31770
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31770&action=edit
full source code example
Multiple parameter pack expansion for variadic templates is broken since 4.8.x
versions. The parameter pack expansion itself works with g++ 4.7.x. But the
order of expanded parms was wrong. This bug was fixed in 4.8.x but mutiple
expansion is now broken.
The code fails with the follwing results:
/opt/linux-gnu_4.9-20140105/bin/g++ --std=c++11 zwei.cpp -O0 -g -pedantic -Wall
-o go2
zwei.cpp: In instantiation of 'CheckVariadic<std::tuple<_Elements ...>,
std::tuple<_Elements ...> >::CheckVariadic(T1 ..., T2 ..., T1 ...) [with T1 =
{int, float}; T2 = {char, void*}]':
zwei.cpp:53:115: required from here
zwei.cpp:47:116: error: mismatched argument pack lengths while expanding
'DebugPrinter<T1, T2, T1 ...>'
CheckVariadic( T1... args1, T2... args2, T1... args3): DebugPrinter<
T1, T2, T1...>(args1, args2..., args1)... {}
The problem occurs in this line of code:
CheckVariadic( T1... args1, T2... args2, T1... args3): DebugPrinter< T1, T2,
T1...>(args1, args2..., args1)... {}
The attachment compiles with clang3.3 & clang3.4 as expected.
More information about the Gcc-bugs
mailing list