https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125884
Bug ID: 125884
Summary: ICE when constructing an aggregate from an empty type
with EBO enabled returned from a function
Product: gcc
Version: 16.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: joel.falcou at lri dot fr
Target Milestone: ---
The following code https://godbolt.org/z/MqG8q65cd
triggers an ICE :
<source>: In instantiation of 'constexpr auto algo(T&&) [with T = test<int,
int, int, int, int, int>]':
<source>:34:18: required from here
34 | auto x = algo(test{1,2,3,4,5,6});
| ~~~~^~~~~~~~~~~~~~~~~~~
<source>:29:41: internal compiler error: in init_subob_ctx, at
cp/constexpr.cc:6706
29 | return test{ctor(std::forward<T>(t))};
| ^
0x226a6a8 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x226399b internal_error(char const*, ...)
???:0
0x7f8eda fancy_abort(char const*, int, char const*)
???:0
0x84e2d6 cxx_eval_constant_expression(constexpr_ctx const*, tree_node*,
value_cat, bool*, bool*, tree_node**)
???:0
0x84e2d6 cxx_eval_constant_expression(constexpr_ctx const*, tree_node*,
value_cat, bool*, bool*, tree_node**)
???:0
0xa3525c finish_compound_literal(tree_node*, tree_node*, int, fcl_t)
???:0
0xa03557 instantiate_decl(tree_node*, bool, bool)
???:0
0x8c7761 maybe_instantiate_decl(tree_node*)
???:0
0x8c8d97 mark_used(tree_node*, int)
???:0
0x8291a7 build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
???:0
0xa36b34 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
???:0
0x9c751d c_parse_file()
???:0
0xaf3a69 c_common_parse_file()
???:0
/cefs/38/383ad2f84cbd57a52fd68bbe_consolidated/compilers_c++_x86_gcc_16.1.0/bin/../libexec/gcc/x86_64-linux-gnu/16.1.0/cc1plus
-quiet -imultiarch x86_64-linux-gnu -iprefix
/cefs/38/383ad2f84cbd57a52fd68bbe_consolidated/compilers_c++_x86_gcc_16.1.0/bin/../lib/gcc/x86_64-linux-gnu/16.1.0/
-D_GNU_SOURCE -isystem /opt/compiler-explorer/libs/kumi/trunk/include <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
---------------------
This is a regression from g++ 15.x