public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101903] New: [9/10/11/12 Regression] ICE with invalid constexpr constructor in template class
@ 2021-08-13 20:15 reichelt at gcc dot gnu.org
2021-08-16 7:59 ` [Bug c++/101903] " marxin at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: reichelt at gcc dot gnu.org @ 2021-08-13 20:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101903
Bug ID: 101903
Summary: [9/10/11/12 Regression] ICE with invalid constexpr
constructor in template class
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: error-recovery, ice-on-invalid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: reichelt at gcc dot gnu.org
Target Milestone: ---
The following invalid code snippet triggers an ICE since GCC 7.1.0:
===============================
template<int> struct A
{
int i{};
A();
constexpr A(int) : A() {}
};
constexpr A<0> a{0};
===============================
bug.cc:9:19: error: 'constexpr A<<anonymous> >::A(int) [with int <anonymous> =
0]' called in a constant expression
9 | constexpr A<0> a{0};
| ^
bug.cc:6:13: note: 'constexpr A<<anonymous> >::A(int) [with int <anonymous> =
0]' is not usable as a 'constexpr' function because:
6 | constexpr A(int) : A() {}
| ^
bug.cc:6:13: internal compiler error: in build_data_member_initialization, at
cp/constexpr.c:400
0x66cf30 build_data_member_initialization
../../gcc/gcc/cp/constexpr.c:400
0x960432 build_constexpr_constructor_member_initializers
../../gcc/gcc/cp/constexpr.c:612
0x960432 massage_constexpr_body
../../gcc/gcc/cp/constexpr.c:738
0x96ce3d explain_invalid_constexpr_fn(tree_node*)
../../gcc/gcc/cp/constexpr.c:982
0x9621e1 cxx_eval_call_expression
../../gcc/gcc/cp/constexpr.c:2594
0x96543c cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:6269
0x968cc4 cxx_eval_outermost_constant_expr
../../gcc/gcc/cp/constexpr.c:7301
0x96da7e maybe_constant_init_1
../../gcc/gcc/cp/constexpr.c:7756
0xb9902a store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
../../gcc/gcc/cp/typeck2.c:777
0x9b4cc6 check_initializer
../../gcc/gcc/cp/decl.c:7185
0x9dab09 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/gcc/cp/decl.c:8119
0xac5174 cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:22556
0xaa0773 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:15088
0xacfdb5 cp_parser_declaration
../../gcc/gcc/cp/parser.c:14787
0xad078e cp_parser_toplevel_declaration
../../gcc/gcc/cp/parser.c:14808
0xad078e cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4978
0xad078e c_parse_file()
../../gcc/gcc/cp/parser.c:46558
0xbf924d c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1223
Please submit a full bug report, [etc.]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/101903] [9/10/11/12 Regression] ICE with invalid constexpr constructor in template class
2021-08-13 20:15 [Bug c++/101903] New: [9/10/11/12 Regression] ICE with invalid constexpr constructor in template class reichelt at gcc dot gnu.org
@ 2021-08-16 7:59 ` marxin at gcc dot gnu.org
2021-08-16 9:00 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-08-16 7:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101903
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2021-08-16
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, started with r7-2529-g23f4e590fb4ce718.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/101903] [9/10/11/12 Regression] ICE with invalid constexpr constructor in template class
2021-08-13 20:15 [Bug c++/101903] New: [9/10/11/12 Regression] ICE with invalid constexpr constructor in template class reichelt at gcc dot gnu.org
2021-08-16 7:59 ` [Bug c++/101903] " marxin at gcc dot gnu.org
@ 2021-08-16 9:00 ` rguenth at gcc dot gnu.org
2022-05-27 9:46 ` [Bug c++/101903] [10/11/12/13 " rguenth at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-08-16 9:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101903
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |9.5
Priority|P3 |P4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/101903] [10/11/12/13 Regression] ICE with invalid constexpr constructor in template class
2021-08-13 20:15 [Bug c++/101903] New: [9/10/11/12 Regression] ICE with invalid constexpr constructor in template class reichelt at gcc dot gnu.org
2021-08-16 7:59 ` [Bug c++/101903] " marxin at gcc dot gnu.org
2021-08-16 9:00 ` rguenth at gcc dot gnu.org
@ 2022-05-27 9:46 ` rguenth at gcc dot gnu.org
2022-06-28 10:46 ` jakub at gcc dot gnu.org
2023-07-07 10:40 ` [Bug c++/101903] [11/12/13/14 " rguenth at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27 9:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101903
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|9.5 |10.4
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/101903] [10/11/12/13 Regression] ICE with invalid constexpr constructor in template class
2021-08-13 20:15 [Bug c++/101903] New: [9/10/11/12 Regression] ICE with invalid constexpr constructor in template class reichelt at gcc dot gnu.org
` (2 preceding siblings ...)
2022-05-27 9:46 ` [Bug c++/101903] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:46 ` jakub at gcc dot gnu.org
2023-07-07 10:40 ` [Bug c++/101903] [11/12/13/14 " rguenth at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101903
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.4 |10.5
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/101903] [11/12/13/14 Regression] ICE with invalid constexpr constructor in template class
2021-08-13 20:15 [Bug c++/101903] New: [9/10/11/12 Regression] ICE with invalid constexpr constructor in template class reichelt at gcc dot gnu.org
` (3 preceding siblings ...)
2022-06-28 10:46 ` jakub at gcc dot gnu.org
@ 2023-07-07 10:40 ` rguenth at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101903
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.5 |11.5
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-07-07 10:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-13 20:15 [Bug c++/101903] New: [9/10/11/12 Regression] ICE with invalid constexpr constructor in template class reichelt at gcc dot gnu.org
2021-08-16 7:59 ` [Bug c++/101903] " marxin at gcc dot gnu.org
2021-08-16 9:00 ` rguenth at gcc dot gnu.org
2022-05-27 9:46 ` [Bug c++/101903] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:46 ` jakub at gcc dot gnu.org
2023-07-07 10:40 ` [Bug c++/101903] [11/12/13/14 " rguenth 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).