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

            Bug ID: 121325
           Summary: ICE on pack index in noexcept specifier of generic
                    lambda in requires clause
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eczbek.void at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/rM5s13j3f



void f(auto... a) requires requires { []<int i = 0> noexcept(noexcept(a...[i]))
{}(); } {}

int main() { f(0); }



<source>: In instantiation of '<lambda()> [with int i = 0]':
<source>:1:83:   required by substitution of 'template<class ... auto:1> void
f(auto:1 ...) requires requires{(<lambda>)();} [with auto:1 = {int}]'
    1 | void f(auto... a) requires requires { []<int i = 0>
noexcept(noexcept(a...[i])) {}(); } {}
      |                                      
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
<source>:3:15:   required from here
    3 | int main() { f(0); }
      |              ~^~~
<source>:1:39: internal compiler error: in tsubst_expr, at cp/pt.cc:22175
    1 | void f(auto... a) requires requires { []<int i = 0>
noexcept(noexcept(a...[i])) {}(); } {}
      |                                       ^
0x288a1c5 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x287fa76 internal_error(char const*, ...)
        ???:0
0xaf6192 fancy_abort(char const*, int, char const*)
        ???:0
0xd74619 tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd59067 tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd76f14 tsubst_pack_index(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd43e8b maybe_instantiate_noexcept(tree_node*, int)
        ???:0
0xc05b1a mark_used(tree_node*, int)
        ???:0
0xb32973 build_op_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int)
        ???:0
0xda6d8e finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ???:0
0xb848e6 tsubst_requires_expr(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xb85d78 constraints_satisfied_p(tree_node*, tree_node*)
        ???:0
0xd84a71 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool,
bool)
        ???:0
0xb2e069 build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        ???:0
0xda69ac finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ???:0
0xd24083 c_parse_file()
        ???:0
0xe8ec79 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

Reply via email to