This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/53786] [C++11] alias template causes g++ segfault


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53786

--- Comment #4 from Hristo Venev <mustrumr97 at gmail dot com> 2012-12-19 13:51:08 UTC ---
That bug was fixed. However there is still another one:

template<class... Data>
struct List{};
template<class T, class... Ts>
using Tail=List<Ts...>;
template<class... Ts>
using Tail2=Tail<Ts...>;
using A=Tail2<int, char, char>;

fail.cpp: In substitution of âtemplate<class T, class ... Ts> using Tail =
List<Ts ...> [with T = int; Ts = char]â:
fail.cpp:6:24:   required by substitution of âtemplate<class ... Ts> using
Tail2 = Tail<Ts ...> [with Ts = {int, char, char}]â
fail.cpp:7:30:   required from here
fail.cpp:4:23: error: template argument 1 is invalid
 using Tail=List<Ts...>;
                       ^
In the diagnostic it is said that in the instantiation of Tail<int, char, char>
Ts is char, it should be {char, char} - a list of types, not a single type.

Additionally when `using A=Tail2<>;` (which is invalid) the compiler still
crashes.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]