This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53786] [C++11] alias template causes g++ segfault
- From: "mustrumr97 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Dec 2012 13:51:08 +0000
- Subject: [Bug c++/53786] [C++11] alias template causes g++ segfault
- Auto-submitted: auto-generated
- References: <bug-53786-4@http.gcc.gnu.org/bugzilla/>
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.