public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53786] New: [C++11] alias template causes g++ segfault
@ 2012-06-27 14:20 mustrumr97 at gmail dot com
2012-06-27 22:18 ` [Bug c++/53786] " daniel.kruegler at googlemail dot com
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: mustrumr97 at gmail dot com @ 2012-06-27 14:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53786
Bug #: 53786
Summary: [C++11] alias template causes g++ segfault
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: mustrumr97@gmail.com
template<class... types>
class list{
public:
template<class t, class... ts>
using tail_=list<ts...>;
using tail=tail_<types...>;
};
using l=list<int>;
will make gcc 4.7.1 segfault
test.cpp:5:32: internal compiler error: Segmentation fault
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/53786] [C++11] alias template causes g++ segfault
2012-06-27 14:20 [Bug c++/53786] New: [C++11] alias template causes g++ segfault mustrumr97 at gmail dot com
@ 2012-06-27 22:18 ` daniel.kruegler at googlemail dot com
2012-06-30 15:19 ` mustrumr97 at gmail dot com
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-06-27 22:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53786
Daniel Krügler <daniel.kruegler at googlemail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.kruegler at
| |googlemail dot com
--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-06-27 22:18:16 UTC ---
The problem still persists in gcc 4.8.0 20120624 (experimental):
"5|internal compiler error: tree check: accessed elt 2 of tree_vec with 1 elts
in tsubst_pack_expansion, at cp/pt.c:9374"
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/53786] [C++11] alias template causes g++ segfault
2012-06-27 14:20 [Bug c++/53786] New: [C++11] alias template causes g++ segfault mustrumr97 at gmail dot com
2012-06-27 22:18 ` [Bug c++/53786] " daniel.kruegler at googlemail dot com
@ 2012-06-30 15:19 ` mustrumr97 at gmail dot com
2012-07-25 9:45 ` paolo.carlini at oracle dot com
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: mustrumr97 at gmail dot com @ 2012-06-30 15:19 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53786
--- Comment #2 from Hristo Venev <mustrumr97 at gmail dot com> 2012-06-30 15:19:29 UTC ---
Reduced:
template<class... x>
class list{};
template<class a, class... b>
using tail=list<b...>;
template<class... x>
using tail2=tail<x...>;
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/53786] [C++11] alias template causes g++ segfault
2012-06-27 14:20 [Bug c++/53786] New: [C++11] alias template causes g++ segfault mustrumr97 at gmail dot com
2012-06-27 22:18 ` [Bug c++/53786] " daniel.kruegler at googlemail dot com
2012-06-30 15:19 ` mustrumr97 at gmail dot com
@ 2012-07-25 9:45 ` paolo.carlini at oracle dot com
2012-12-19 13:51 ` mustrumr97 at gmail dot com
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-07-25 9:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53786
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-07-25
Ever Confirmed|0 |1
--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-07-25 09:45:23 UTC ---
Confirmed.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/53786] [C++11] alias template causes g++ segfault
2012-06-27 14:20 [Bug c++/53786] New: [C++11] alias template causes g++ segfault mustrumr97 at gmail dot com
` (2 preceding siblings ...)
2012-07-25 9:45 ` paolo.carlini at oracle dot com
@ 2012-12-19 13:51 ` mustrumr97 at gmail dot com
2013-04-04 16:55 ` [Bug c++/53786] [C++11] alias template - error on valid code jason at gcc dot gnu.org
2013-04-05 16:29 ` jason at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: mustrumr97 at gmail dot com @ 2012-12-19 13:51 UTC (permalink / raw)
To: gcc-bugs
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/53786] [C++11] alias template - error on valid code
2012-06-27 14:20 [Bug c++/53786] New: [C++11] alias template causes g++ segfault mustrumr97 at gmail dot com
` (3 preceding siblings ...)
2012-12-19 13:51 ` mustrumr97 at gmail dot com
@ 2013-04-04 16:55 ` jason at gcc dot gnu.org
2013-04-05 16:29 ` jason at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2013-04-04 16:55 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53786
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-invalid-code
--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2013-04-04 16:55:32 UTC ---
This looks like issue 1430:
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1430
As in the example in the issue description, here there is no way to express
tail_<types...> in terms of list and types, so I think this will also be
ill-formed. Other people on the committee seem to agree with me.
Of course, we shouldn't ICE.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/53786] [C++11] alias template - error on valid code
2012-06-27 14:20 [Bug c++/53786] New: [C++11] alias template causes g++ segfault mustrumr97 at gmail dot com
` (4 preceding siblings ...)
2013-04-04 16:55 ` [Bug c++/53786] [C++11] alias template - error on valid code jason at gcc dot gnu.org
@ 2013-04-05 16:29 ` jason at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2013-04-05 16:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53786
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2013-04-05 16:29:42 UTC ---
Same issue, similar testcase to 51239.
*** This bug has been marked as a duplicate of bug 51239 ***
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-04-05 16:29 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-27 14:20 [Bug c++/53786] New: [C++11] alias template causes g++ segfault mustrumr97 at gmail dot com
2012-06-27 22:18 ` [Bug c++/53786] " daniel.kruegler at googlemail dot com
2012-06-30 15:19 ` mustrumr97 at gmail dot com
2012-07-25 9:45 ` paolo.carlini at oracle dot com
2012-12-19 13:51 ` mustrumr97 at gmail dot com
2013-04-04 16:55 ` [Bug c++/53786] [C++11] alias template - error on valid code jason at gcc dot gnu.org
2013-04-05 16:29 ` jason at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).