public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c++/58612] New: [4.8/4.9 Regression] [c++11] ICE calling non-constexpr from constexpr in template class @ 2013-10-03 21:49 reichelt at gcc dot gnu.org 2013-10-10 11:42 ` [Bug c++/58612] " rguenth at gcc dot gnu.org ` (6 more replies) 0 siblings, 7 replies; 8+ messages in thread From: reichelt at gcc dot gnu.org @ 2013-10-03 21:49 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58612 Bug ID: 58612 Summary: [4.8/4.9 Regression] [c++11] ICE calling non-constexpr from constexpr in 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 invalid code snippet (compiled with "-std=c++11") triggers an ICE on the 4.8 branch (since at least 4.8.2 20130920) and trunk: =============================================== struct A { int foo() const { return 0; } }; template<typename> struct B { A a; constexpr int bar() { return a.foo(); } }; constexpr int i = B<void>().bar(); =============================================== bug.cc:12:33: error: 'constexpr int B< <template-parameter-1-1> >::bar() const [with <template-parameter-1-1> = void]' called in a constant expression constexpr int i = B<void>().bar(); ^ bug.cc:9:17: note: 'constexpr int B< <template-parameter-1-1> >::bar() const [with <template-parameter-1-1> = void]' is not usable as a constexpr function because: constexpr int bar() { return a.foo(); } ^ bug.cc:9:17: internal compiler error: Segmentation fault 0xaef62f crash_signal ../../gcc/gcc/toplev.c:335 0xcf44ba walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, pointer_set_t*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, pointer_set_t*)) ../../gcc/gcc/tree.c:10934 0xcf48e5 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, pointer_set_t*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, pointer_set_t*)) ../../gcc/gcc/tree.c:11191 0x6d0347 break_out_target_exprs(tree_node*) ../../gcc/gcc/cp/tree.c:2366 0x6c19eb massage_constexpr_body ../../gcc/gcc/cp/semantics.c:6299 0x6c2388 explain_invalid_constexpr_fn(tree_node*) ../../gcc/gcc/cp/semantics.c:6462 0x6c2986 cxx_eval_call_expression ../../gcc/gcc/cp/semantics.c:6831 0x6c3f4f cxx_eval_constant_expression ../../gcc/gcc/cp/semantics.c:7904 0x6c6f66 cxx_eval_outermost_constant_expr ../../gcc/gcc/cp/semantics.c:8217 0x5e0c75 store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) ../../gcc/gcc/cp/typeck2.c:786 0x557408 check_initializer ../../gcc/gcc/cp/decl.c:5728 0x56a2ec cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int) ../../gcc/gcc/cp/decl.c:6347 0x65119f cp_parser_init_declarator ../../gcc/gcc/cp/parser.c:16568 0x6518bf cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:10986 0x653740 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:10867 0x65c76e cp_parser_declaration ../../gcc/gcc/cp/parser.c:10764 0x65b4da cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10650 0x65cda6 cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:3939 0x65cda6 c_parse_file() ../../gcc/gcc/cp/parser.c:28900 0x7707e3 c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1046 Please submit a full bug report, [etc.] ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/58612] [4.8/4.9 Regression] [c++11] ICE calling non-constexpr from constexpr in template class 2013-10-03 21:49 [Bug c++/58612] New: [4.8/4.9 Regression] [c++11] ICE calling non-constexpr from constexpr in template class reichelt at gcc dot gnu.org @ 2013-10-10 11:42 ` rguenth at gcc dot gnu.org 2013-10-16 9:50 ` jakub at gcc dot gnu.org ` (5 subsequent siblings) 6 siblings, 0 replies; 8+ messages in thread From: rguenth at gcc dot gnu.org @ 2013-10-10 11:42 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58612 Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |4.8.2 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/58612] [4.8/4.9 Regression] [c++11] ICE calling non-constexpr from constexpr in template class 2013-10-03 21:49 [Bug c++/58612] New: [4.8/4.9 Regression] [c++11] ICE calling non-constexpr from constexpr in template class reichelt at gcc dot gnu.org 2013-10-10 11:42 ` [Bug c++/58612] " rguenth at gcc dot gnu.org @ 2013-10-16 9:50 ` jakub at gcc dot gnu.org 2013-11-19 9:55 ` rguenth at gcc dot gnu.org ` (4 subsequent siblings) 6 siblings, 0 replies; 8+ messages in thread From: jakub at gcc dot gnu.org @ 2013-10-16 9:50 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58612 Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|4.8.2 |4.8.3 --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- GCC 4.8.2 has been released. ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/58612] [4.8/4.9 Regression] [c++11] ICE calling non-constexpr from constexpr in template class 2013-10-03 21:49 [Bug c++/58612] New: [4.8/4.9 Regression] [c++11] ICE calling non-constexpr from constexpr in template class reichelt at gcc dot gnu.org 2013-10-10 11:42 ` [Bug c++/58612] " rguenth at gcc dot gnu.org 2013-10-16 9:50 ` jakub at gcc dot gnu.org @ 2013-11-19 9:55 ` rguenth at gcc dot gnu.org 2014-05-22 9:04 ` [Bug c++/58612] [4.8/4.9/4.10 " rguenth at gcc dot gnu.org ` (3 subsequent siblings) 6 siblings, 0 replies; 8+ messages in thread From: rguenth at gcc dot gnu.org @ 2013-11-19 9:55 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58612 Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |error-recovery, | |ice-on-invalid-code Priority|P3 |P5 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/58612] [4.8/4.9/4.10 Regression] [c++11] ICE calling non-constexpr from constexpr in template class 2013-10-03 21:49 [Bug c++/58612] New: [4.8/4.9 Regression] [c++11] ICE calling non-constexpr from constexpr in template class reichelt at gcc dot gnu.org ` (2 preceding siblings ...) 2013-11-19 9:55 ` rguenth at gcc dot gnu.org @ 2014-05-22 9:04 ` rguenth at gcc dot gnu.org 2014-07-13 16:53 ` jason at gcc dot gnu.org ` (2 subsequent siblings) 6 siblings, 0 replies; 8+ messages in thread From: rguenth at gcc dot gnu.org @ 2014-05-22 9:04 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58612 Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|4.8.3 |4.8.4 --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- GCC 4.8.3 is being released, adjusting target milestone. ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/58612] [4.8/4.9/4.10 Regression] [c++11] ICE calling non-constexpr from constexpr in template class 2013-10-03 21:49 [Bug c++/58612] New: [4.8/4.9 Regression] [c++11] ICE calling non-constexpr from constexpr in template class reichelt at gcc dot gnu.org ` (3 preceding siblings ...) 2014-05-22 9:04 ` [Bug c++/58612] [4.8/4.9/4.10 " rguenth at gcc dot gnu.org @ 2014-07-13 16:53 ` jason at gcc dot gnu.org 2014-07-14 5:26 ` jason at gcc dot gnu.org 2014-07-14 5:27 ` jason at gcc dot gnu.org 6 siblings, 0 replies; 8+ messages in thread From: jason at gcc dot gnu.org @ 2014-07-13 16:53 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58612 Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2014-07-13 CC| |jason at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org Ever confirmed|0 |1 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/58612] [4.8/4.9/4.10 Regression] [c++11] ICE calling non-constexpr from constexpr in template class 2013-10-03 21:49 [Bug c++/58612] New: [4.8/4.9 Regression] [c++11] ICE calling non-constexpr from constexpr in template class reichelt at gcc dot gnu.org ` (4 preceding siblings ...) 2014-07-13 16:53 ` jason at gcc dot gnu.org @ 2014-07-14 5:26 ` jason at gcc dot gnu.org 2014-07-14 5:27 ` jason at gcc dot gnu.org 6 siblings, 0 replies; 8+ messages in thread From: jason at gcc dot gnu.org @ 2014-07-14 5:26 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58612 --- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> --- Author: jason Date: Mon Jul 14 05:25:25 2014 New Revision: 212505 URL: https://gcc.gnu.org/viewcvs?rev=212505&root=gcc&view=rev Log: PR c++/58612 * tree.c (bot_replace): Only replace a dummy 'this' parm. Added: trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-neg3.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/tree.c ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/58612] [4.8/4.9/4.10 Regression] [c++11] ICE calling non-constexpr from constexpr in template class 2013-10-03 21:49 [Bug c++/58612] New: [4.8/4.9 Regression] [c++11] ICE calling non-constexpr from constexpr in template class reichelt at gcc dot gnu.org ` (5 preceding siblings ...) 2014-07-14 5:26 ` jason at gcc dot gnu.org @ 2014-07-14 5:27 ` jason at gcc dot gnu.org 6 siblings, 0 replies; 8+ messages in thread From: jason at gcc dot gnu.org @ 2014-07-14 5:27 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58612 Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |FIXED Target Milestone|4.8.4 |4.10.0 --- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> --- Fixed on trunk. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-07-14 5:27 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2013-10-03 21:49 [Bug c++/58612] New: [4.8/4.9 Regression] [c++11] ICE calling non-constexpr from constexpr in template class reichelt at gcc dot gnu.org 2013-10-10 11:42 ` [Bug c++/58612] " rguenth at gcc dot gnu.org 2013-10-16 9:50 ` jakub at gcc dot gnu.org 2013-11-19 9:55 ` rguenth at gcc dot gnu.org 2014-05-22 9:04 ` [Bug c++/58612] [4.8/4.9/4.10 " rguenth at gcc dot gnu.org 2014-07-13 16:53 ` jason at gcc dot gnu.org 2014-07-14 5:26 ` jason at gcc dot gnu.org 2014-07-14 5:27 ` 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).