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

            Bug ID: 122318
           Summary: [14/15/16 Regression] ICE on CTAD for alias template
                    with lambda
           Product: gcc
           Version: 15.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cmingyi01 at gmail dot com
  Target Milestone: ---

The following C++20 code causes an ICE since GCC 14.
```
template <class T, auto>
struct Params {
    constexpr Params(T) {}
};

template <class T>
using MyParams = Params<T, [] {}>;

template <MyParams>
struct Doc {};

template <int I>
Doc<I> a{};

auto a0 = a<0>;
```

Output:
```
<source>: In substitution of 'template<class T> Params(Params<T, <lambda> >) ->
Params<T, <lambda> > [with T = <missing>]':
required from here
<source>:13:8:   
   13 | Doc<I> a{};
      |        ^
<source>:13:8: internal compiler error: in unify, at cp/pt.cc:26338
0x28de9f8 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x28d37eb internal_error(char const*, ...)
        ???:0
0xb06fa8 fancy_abort(char const*, int, char const*)
        ???:0
0xda46a1 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool,
bool)
        ???:0
0xb39699 perform_dguide_overload_resolution(tree_node*, vec<tree_node*, va_gc,
vl_embed> const*, int)
        ???:0
0xd67992 do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int, tree_node*)
        ???:0
0xd897e3 coerce_template_parms(tree_node*, tree_node*, tree_node*, int, bool)
        ???:0
0xd7625d lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int)
        ???:0
0xd77719 tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd93b1d instantiate_template(tree_node*, tree_node*, int)
        ???:0
0xdd85f4 finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*,
bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned long)
        ???:0
0xd3fdb3 c_parse_file()
        ???:0
0xeb04a9 c_common_parse_file()
        ???:0
```

See https://compiler-explorer.com/z/qfboxvnGe.

Reply via email to