http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60153
Bug ID: 60153
Summary: Variadic template parameter's typedefs cause internal
compile error: in dependent_type_p on RedHat
Product: gcc
Version: 4.8.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: nclimer at gmail dot com
Created attachment 32109
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32109&action=edit
preprocessed source
While playing with variadic template, I ran into the following error:
#include <iostream>
enum class foo :int {x,y,z};
//class we're trying to generate
template <int a, foo b>
class A
{
public:
A()
{
std::cout << a << "," << (int)b << std::endl;
}
};
//class which generates information
template <typename T>
struct B
{
typedef T value_type;
static const T val;
};
template <typename... B>
struct madscience_intitializer
{
template <typename B::value_type... args>
using ret_type = A<args...>;
};
int main(int argc, char** argv)
{
madscience_intitializer<B<int>,B<foo> >::ret_type<1,foo::y> a;
}
Causes this error:
main2.cpp: In function ‘int main(int, char**)’:
main2.cpp:37:61: internal compiler error: in dependent_type_p, at cp/pt.c:19526
madscience_intitializer<B<int>,B<foo> >::ret_type<1,foo::y> a;
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccqXFjQG.out file, please attach this to
your bugreport.
make: *** [main2] Error 1
g++ version
g++ (GCC) 4.8.2 20131212 (Red Hat 4.8.2-7)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.