https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127678
hello at nathanbaggs dot co.uk changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|ICE/Regression with |ICE/Regression with
|constexpr braced |constexpr braced
|initialisation in templte |initialisation in template
--- Comment #1 from hello at nathanbaggs dot co.uk ---
template<class T>
void foo()
{
constexpr float s = float{};
}
Works in 16.2 but not in trunk. Works if foo is non-templated or constexpr is
dropped from s. Also breaks if taking an auto function parameter
<source>: In function 'void foo()':
<source>:4:31: internal compiler error: in verify_ctor_sanity, at
cp/constexpr.cc:7384
4 | constexpr float s = float{};
| ^
0x2c6f998 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x2c645db internal_error(char const*, ...)
???:0
0xb81d98 fancy_abort(char const*, int, char const*)
???:0
0xbf2020 cxx_eval_constant_expression(constexpr_ctx const*, tree_node*,
value_cat, bool*, bool*, tree_node**)
???:0
0xeec17f store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
???:0
0xc96352 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int,
cp_decomp*)
???:0
0xddb083 c_parse_file()
???:0
0xf6ec59 c_common_parse_file()
???:0
/cefs/fe/fe822f0ee33716529a5b27ba_gcc-trunk-20260930/bin/../libexec/gcc/x86_64-linux-gnu/17.0.0/cc1plus
-quiet -imultiarch x86_64-linux-gnu -iprefix
/cefs/fe/fe822f0ee33716529a5b27ba_gcc-trunk-20260930/bin/../lib/gcc/x86_64-linux-gnu/17.0.0/
-D_GNU_SOURCE <source> -quiet -dumpdir /app/ -dumpbase output.cpp -dumpbase-ext
.cpp -masm=intel -mtune=generic -march=x86-64 -g -fdiagnostics-color=always
-fno-verbose-asm -o /app/output.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
Godbolt: https://godbolt.org/z/jv6es9zEv