public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58704] New: [c++11] ICE initializing array member of template class
@ 2013-10-12 21:21 reichelt at gcc dot gnu.org
2013-10-14 11:35 ` [Bug c++/58704] " mpolacek at gcc dot gnu.org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-10-12 21:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58704
Bug ID: 58704
Summary: [c++11] ICE initializing array member of template
class
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: reichelt at gcc dot gnu.org
The following valid code snippet (compiled with "-std=c++11") triggers an ICE
since GCC 4.7.0 (when non-static data member initializers were introduced):
=================================
struct A {};
template<typename> struct B
{
A a[1] = {};
};
B<int> b;
=================================
bug.cc: In constructor 'constexpr B<int>::B()':
bug.cc:3:27: internal compiler error: tree check: expected tree that contains
'common' structure, have 'constructor' in perform_member_init, at cp/init.c:665
template<typename> struct B
^
0xd159c7 tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
../../gcc/gcc/tree.c:9472
0x6a3e2d contains_struct_check
../../gcc/gcc/tree.h:2788
0x6a3e2d perform_member_init
../../gcc/gcc/cp/init.c:665
0x6a3e2d emit_mem_initializers(tree_node*)
../../gcc/gcc/cp/init.c:1096
0x6acfae synthesize_method(tree_node*)
../../gcc/gcc/cp/method.c:796
0x61e379 mark_used(tree_node*, int)
../../gcc/gcc/cp/decl2.c:4778
0x54d0b6 build_over_call
../../gcc/gcc/cp/call.c:7116
0x548eae build_new_method_call_1
../../gcc/gcc/cp/call.c:7813
0x548eae build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
../../gcc/gcc/cp/call.c:7883
0x549e22 build_special_member_call(tree_node*, tree_node*, vec<tree_node*,
va_gc, vl_embed>**, tree_node*, int, int)
../../gcc/gcc/cp/call.c:7440
0x69eba7 expand_default_init
../../gcc/gcc/cp/init.c:1668
0x69eba7 expand_aggr_init_1
../../gcc/gcc/cp/init.c:1769
0x6a1779 build_aggr_init(tree_node*, tree_node*, int, int)
../../gcc/gcc/cp/init.c:1520
0x55e005 build_aggr_init_full_exprs
../../gcc/gcc/cp/decl.c:5552
0x55e005 check_initializer
../../gcc/gcc/cp/decl.c:5687
0x570ccc cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/gcc/cp/decl.c:6356
0x65e7e7 cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:16633
0x65ff2f cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:11047
0x643860 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:10928
0x66aaae cp_parser_declaration
../../gcc/gcc/cp/parser.c:10825
Please submit a full bug report, [etc.]
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/58704] [c++11] ICE initializing array member of template class
2013-10-12 21:21 [Bug c++/58704] New: [c++11] ICE initializing array member of template class reichelt at gcc dot gnu.org
@ 2013-10-14 11:35 ` mpolacek at gcc dot gnu.org
2014-03-18 18:41 ` paolo.carlini at oracle dot com
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-10-14 11:35 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58704
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-10-14
CC| |mpolacek at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/58704] [c++11] ICE initializing array member of template class
2013-10-12 21:21 [Bug c++/58704] New: [c++11] ICE initializing array member of template class reichelt at gcc dot gnu.org
2013-10-14 11:35 ` [Bug c++/58704] " mpolacek at gcc dot gnu.org
@ 2014-03-18 18:41 ` paolo.carlini at oracle dot com
2014-05-20 14:04 ` paolo.carlini at oracle dot com
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-03-18 18:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58704
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |a.matveyakin at gmail dot com
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
*** Bug 60386 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/58704] [c++11] ICE initializing array member of template class
2013-10-12 21:21 [Bug c++/58704] New: [c++11] ICE initializing array member of template class reichelt at gcc dot gnu.org
2013-10-14 11:35 ` [Bug c++/58704] " mpolacek at gcc dot gnu.org
2014-03-18 18:41 ` paolo.carlini at oracle dot com
@ 2014-05-20 14:04 ` paolo.carlini at oracle dot com
2014-05-20 19:21 ` paolo at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-05-20 14:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58704
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |paolo.carlini at oracle dot com
--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Mine. Related to c++/58753 and c++/58930.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/58704] [c++11] ICE initializing array member of template class
2013-10-12 21:21 [Bug c++/58704] New: [c++11] ICE initializing array member of template class reichelt at gcc dot gnu.org
` (2 preceding siblings ...)
2014-05-20 14:04 ` paolo.carlini at oracle dot com
@ 2014-05-20 19:21 ` paolo at gcc dot gnu.org
2014-05-20 19:24 ` paolo.carlini at oracle dot com
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: paolo at gcc dot gnu.org @ 2014-05-20 19:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58704
--- Comment #4 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Tue May 20 19:20:59 2014
New Revision: 210653
URL: http://gcc.gnu.org/viewcvs?rev=210653&root=gcc&view=rev
Log:
/cp
2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58753
PR c++/58930
PR c++/58704
* typeck2.c (digest_nsdmi_init): New.
* parser.c (cp_parser_late_parse_one_default_arg): Use it.
* init.c (get_nsdmi): Likewise.
* cp-tree.h (digest_nsdmi_init): Declare.
/testsuite
2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58753
PR c++/58930
PR c++/58704
* g++.dg/cpp0x/nsdmi-template11.C: New.
* g++.dg/cpp0x/nsdmi-template12.C: Likewise.
* g++.dg/cpp0x/nsdmi-template13.C: Likewise.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/nsdmi-template11.C
trunk/gcc/testsuite/g++.dg/cpp0x/nsdmi-template12.C
trunk/gcc/testsuite/g++.dg/cpp0x/nsdmi-template13.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/init.c
trunk/gcc/cp/parser.c
trunk/gcc/cp/typeck2.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/58704] [c++11] ICE initializing array member of template class
2013-10-12 21:21 [Bug c++/58704] New: [c++11] ICE initializing array member of template class reichelt at gcc dot gnu.org
` (3 preceding siblings ...)
2014-05-20 19:21 ` paolo at gcc dot gnu.org
@ 2014-05-20 19:24 ` paolo.carlini at oracle dot com
2014-06-13 22:11 ` ppluzhnikov at google dot com
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-05-20 19:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58704
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
Assignee|paolo.carlini at oracle dot com |unassigned at gcc dot gnu.org
Target Milestone|--- |4.10.0
--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed for 4.10.0.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/58704] [c++11] ICE initializing array member of template class
2013-10-12 21:21 [Bug c++/58704] New: [c++11] ICE initializing array member of template class reichelt at gcc dot gnu.org
` (4 preceding siblings ...)
2014-05-20 19:24 ` paolo.carlini at oracle dot com
@ 2014-06-13 22:11 ` ppluzhnikov at google dot com
2014-06-29 8:22 ` paolo.carlini at oracle dot com
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: ppluzhnikov at google dot com @ 2014-06-13 22:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58704
Paul Pluzhnikov <ppluzhnikov at google dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ppluzhnikov at google dot com
--- Comment #6 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
We've hit this in gcc-4.8 and 4.9 as well. Backport?
Google ref: b/15616365
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/58704] [c++11] ICE initializing array member of template class
2013-10-12 21:21 [Bug c++/58704] New: [c++11] ICE initializing array member of template class reichelt at gcc dot gnu.org
` (5 preceding siblings ...)
2014-06-13 22:11 ` ppluzhnikov at google dot com
@ 2014-06-29 8:22 ` paolo.carlini at oracle dot com
2014-07-01 18:47 ` ppluzhnikov at gcc dot gnu.org
2014-08-03 19:40 ` reichelt at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-06-29 8:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58704
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |filip.roseen at gmail dot com
--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> ---
*** Bug 60699 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/58704] [c++11] ICE initializing array member of template class
2013-10-12 21:21 [Bug c++/58704] New: [c++11] ICE initializing array member of template class reichelt at gcc dot gnu.org
` (6 preceding siblings ...)
2014-06-29 8:22 ` paolo.carlini at oracle dot com
@ 2014-07-01 18:47 ` ppluzhnikov at gcc dot gnu.org
2014-08-03 19:40 ` reichelt at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: ppluzhnikov at gcc dot gnu.org @ 2014-07-01 18:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58704
--- Comment #8 from ppluzhnikov at gcc dot gnu.org ---
Author: ppluzhnikov
Date: Tue Jul 1 18:46:26 2014
New Revision: 212207
URL: https://gcc.gnu.org/viewcvs?rev=212207&root=gcc&view=rev
Log:
Backport r210653 from mainline:
gcc/teststuite/ChangeLog:
2014-07-01 Paul Pluzhnikov <ppluzhnikov@google.com>
PR c++/58753
PR c++/58930
PR c++/58704
Backported from mainline
2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/cpp0x/nsdmi-template11.C: New.
* g++.dg/cpp0x/nsdmi-template12.C: Likewise.
* g++.dg/cpp0x/nsdmi-template13.C: Likewise.
gcc/cp/ChangeLog:
2014-07-01 Paul Pluzhnikov <ppluzhnikov@google.com>
PR c++/58753
PR c++/58930
PR c++/58704
Backported from mainline
2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
* typeck2.c (digest_nsdmi_init): New.
* parser.c (cp_parser_late_parse_one_default_arg): Use it.
* init.c (get_nsdmi): Likewise.
* cp-tree.h (digest_nsdmi_init): Declare.
Added:
branches/gcc-4_9-branch/gcc/testsuite/g++.dg/cpp0x/nsdmi-template11.C
branches/gcc-4_9-branch/gcc/testsuite/g++.dg/cpp0x/nsdmi-template12.C
branches/gcc-4_9-branch/gcc/testsuite/g++.dg/cpp0x/nsdmi-template13.C
Modified:
branches/gcc-4_9-branch/gcc/cp/ChangeLog
branches/gcc-4_9-branch/gcc/cp/cp-tree.h
branches/gcc-4_9-branch/gcc/cp/init.c
branches/gcc-4_9-branch/gcc/cp/parser.c
branches/gcc-4_9-branch/gcc/cp/typeck2.c
branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/58704] [c++11] ICE initializing array member of template class
2013-10-12 21:21 [Bug c++/58704] New: [c++11] ICE initializing array member of template class reichelt at gcc dot gnu.org
` (7 preceding siblings ...)
2014-07-01 18:47 ` ppluzhnikov at gcc dot gnu.org
@ 2014-08-03 19:40 ` reichelt at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: reichelt at gcc dot gnu.org @ 2014-08-03 19:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58704
Volker Reichelt <reichelt at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.10.0 |4.9.1
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2014-08-03 19:40 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-12 21:21 [Bug c++/58704] New: [c++11] ICE initializing array member of template class reichelt at gcc dot gnu.org
2013-10-14 11:35 ` [Bug c++/58704] " mpolacek at gcc dot gnu.org
2014-03-18 18:41 ` paolo.carlini at oracle dot com
2014-05-20 14:04 ` paolo.carlini at oracle dot com
2014-05-20 19:21 ` paolo at gcc dot gnu.org
2014-05-20 19:24 ` paolo.carlini at oracle dot com
2014-06-13 22:11 ` ppluzhnikov at google dot com
2014-06-29 8:22 ` paolo.carlini at oracle dot com
2014-07-01 18:47 ` ppluzhnikov at gcc dot gnu.org
2014-08-03 19:40 ` reichelt 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).