This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56774] [4.7/4.8/4.9 Regression] G++ 4.8 reverses variadic template types during unpacking
- From: "w.shane.grant at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 29 Mar 2013 00:21:32 +0000
- Subject: [Bug c++/56774] [4.7/4.8/4.9 Regression] G++ 4.8 reverses variadic template types during unpacking
- Auto-submitted: auto-generated
- References: <bug-56774-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56774
--- Comment #4 from Shane <w.shane.grant at gmail dot com> 2013-03-29 00:21:32 UTC ---
(In reply to comment #1)
> We badly need a reduced testcase not using the whole <tuple> (not to mention
> <iostream> of course)
Here's a more reduced test case.
template <class ... Args>
struct mytype {};
template <class T, class ... Args>
void something( mytype<T, Args...> )
{ }
int main()
{
// Compiles OK in GCC 4.6.3 but NOT 4.8
something<int, char, bool>( mytype<int, char, bool>() );
// Compiles OK in GCC 4.8 but NOT 4.6.3
something<int, bool, char>( mytype<int, char, bool>() );
return 0;
}
I tried to make simpler cases using purely variadic templates (e.g. no class
T), but the issue only shows up when there is an individually named template
parameter as well as a variadic pack. To get the error to show up it also
requires types that cannot be implicitly converted to each other.