https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122730

            Bug ID: 122730
           Summary: ICE when statement expression in member initializer
                    list introduces variable
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: llvm at rifkin dot dev
  Target Milestone: ---

This ICEs gcc:

struct a {
    int b;
    constexpr a() : b{({
        int c{};
        1;
    })} {}
};


<source>: In constructor 'constexpr a::a()':
<source>:6:10: internal compiler error: in bot_manip, at cp/tree.cc:3280
    6 |     })} {}
      |          ^
0x2910608 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x29053cb internal_error(char const*, ...)
        ???:0
0xb0d2f4 fancy_abort(char const*, int, char const*)
        ???:0
0x18a30fc walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0xdf8ef2 break_out_target_exprs(tree_node*, bool)
        ???:0
0xb8faae maybe_save_constexpr_fundef(tree_node*)
        ???:0
0xc083f7 finish_function(bool)
        ???:0
0xd47563 c_parse_file()
        ???:0
0xeb65f9 c_common_parse_file()
        ???:0
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

It appears to have been introduced in gcc 10.3.

https://godbolt.org/z/rMT5j1Gd5

Reply via email to