http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60273
Bug ID: 60273
Summary: gcc gets confused when one class uses variadic
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: walter.mascarenhas at gmail dot com
Created attachment 32171
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32171&action=edit
gcc asked me to submit this file
//
// When compiling this file in Ubuntu 13.04, gcc 4.8.1 crashes with the
// following message. Clang 3.0 compiles the file with no problems.
//
// /home/walter/code/klein/tests/platform/gcc_bug/main.cc:-1: In instantiation
of 'struct Bar<Foo<int> >':
// /home/walter/code/klein/tests/platform/gcc_bug/main.cc:25: required from
here
// /home/walter/code/klein/tests/platform/gcc_bug/main.cc:20: internal compiler
error: Segmentation fault
// template<int... Ns> using Buggy = typename X::template S<Ns...>;
// :-1: error: [main.o] Error 1^
//
struct A {};
template <class X>
struct Foo
{
using Type = int;
// if the next line is replaced by template <int... N> then all is fine
template <int N1, int N2>
using S = A;
};
template <class X>
struct Bar
{
// if the next line is commented then all is fine.
using Type = typename X::Type;
// if the next line is commented then all is fine.
template<int... Ns> using Buggy = typename X::template S<Ns...>;
};
void foobar()
{
Bar< Foo<int> > bf;
}