https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127619
Bug ID: 127619
Summary: [reflection] internal compiler error when
define_static_array gets passed objects containing
pointers to defined static strings
Product: gcc
Version: 16.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: edoardo762 at gmail dot com
Target Milestone: ---
I stumbled upon this ice when messing around with reflection.
The error manifests when i add a "static string" to an existing object in a
vector, which is then later defined as static.
I tried reducing the samlpe but couldn't manage in a reasonable time.
The specific failing line is
// ../../function_array_helper.h:427:29: in ‘constexpr’ expansion of
‘std::define_static_array<vector<LuaFunctionSymbol>&>(internal)’
// 427 | return define_static_array(internal);
// | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
// /usr/include/c++/16/meta:658:50: internal compiler error: in
fold_convert_loc, at fold-const.cc:2800
// 658 | auto __array = meta::reflect_constant_array(__r);
Attached is the preprocessed output generated by -freport-bug