constexpr char f() { return *__func__; } constexpr char c = f(); pf.cc:2:21: in constexpr expansion of ‘f()’ pf.cc:2:22: internal compiler error: Segmentation fault constexpr char c = f(); ^ 0x10ab4173 crash_signal /home/jwakely/src/gcc/gcc/toplev.c:375 0x107394bc vec_safe_reserve<tree_node*, va_gc> /home/jwakely/src/gcc/gcc/vec.h:577 0x107394bc vec_safe_push<tree_node*, va_gc> /home/jwakely/src/gcc/gcc/vec.h:671 0x107394bc add_local_decl(function*, tree_node*) /home/jwakely/src/gcc/gcc/function.c:6702 0x10b4a293 remap_decls /home/jwakely/src/gcc/gcc/tree-inline.c:648 0x10b4b70f remap_block /home/jwakely/src/gcc/gcc/tree-inline.c:718 0x10b51c47 copy_bind_expr /home/jwakely/src/gcc/gcc/tree-inline.c:789 0x10b51c47 copy_tree_body_r(tree_node**, int*, void*) /home/jwakely/src/gcc/gcc/tree-inline.c:1123 0x10df0593 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, default_hashset_traits>*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, default_hashset_traits>*)) /home/jwakely/src/gcc/gcc/tree.c:11182 0x10b42ddb copy_tree_body /home/jwakely/src/gcc/gcc/tree-inline.c:2959 0x10b548e3 copy_fn(tree_node*, tree_node*&, tree_node*&) /home/jwakely/src/gcc/gcc/tree-inline.c:5989 0x1044f3d7 cxx_eval_call_expression /home/jwakely/src/gcc/gcc/cp/constexpr.c:1353 0x10451567 cxx_eval_constant_expression /home/jwakely/src/gcc/gcc/cp/constexpr.c:3074 0x1045871b cxx_eval_outermost_constant_expr /home/jwakely/src/gcc/gcc/cp/constexpr.c:3577 0x1028326b store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) /home/jwakely/src/gcc/gcc/cp/typeck2.c:829 0x101cf907 check_initializer /home/jwakely/src/gcc/gcc/cp/decl.c:6024 0x101ff50f cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int) /home/jwakely/src/gcc/gcc/cp/decl.c:6636 0x1032f163 cp_parser_init_declarator /home/jwakely/src/gcc/gcc/cp/parser.c:17320 0x103320c3 cp_parser_simple_declaration /home/jwakely/src/gcc/gcc/cp/parser.c:11612 0x10329a67 cp_parser_block_declaration /home/jwakely/src/gcc/gcc/cp/parser.c:11486 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions.
Stack trace very similar to c++/66292
*** Bug 66292 has been marked as a duplicate of this bug. ***
*** Bug 67176 has been marked as a duplicate of this bug. ***
Started with r217663.
*** Bug 66982 has been marked as a duplicate of this bug. ***
*** Bug 69149 has been marked as a duplicate of this bug. ***
*** Bug 69813 has been marked as a duplicate of this bug. ***
*** Bug 69814 has been marked as a duplicate of this bug. ***
*** Bug 69812 has been marked as a duplicate of this bug. ***
Bug 70353 is a duplicate of this one. Although this report predates the latter, I'm closing this one since 70353 is the one the fix for 6.0 has been committed under. *** This bug has been marked as a duplicate of bug 70353 ***