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

            Bug ID: 117035
           Summary: ICE in unify, at cp/pt.cc:25410, when specifying
                    lambda expression template argument in partial
                    specialization
           Product: gcc
           Version: 14.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: guyutongxue at 163 dot com
  Target Milestone: ---

```
template <int, auto = [] {}>
struct Foo {};

template <int N>
struct Foo<N> {};

constexpr auto oops = Foo<0>{};
```

causes GCC ICE in all versions from 9.1 to current trunk (15.0). 
Clang and MSVC compiles, while EDG rejects this code. Godbolt: 
https://godbolt.org/z/xWToxf39b


GCC 14.2.0 output:

<source>:7:30: internal compiler error: in unify, at cp/pt.cc:25410
    7 | constexpr auto oops = Foo<0>{};
      |                              ^
0x2031cbc internal_error(char const*, ...)
        ???:0
0x77895f fancy_abort(char const*, int, char const*)
        ???:0
0x928a6d most_specialized_partial_spec(tree_node*, int, bool)
        ???:0
0x94c21e instantiate_class_template(tree_node*)
        ???:0
0x98936b complete_type(tree_node*)
        ???:0
0x95f4d9 finish_compound_literal(tree_node*, tree_node*, int, fcl_t)
        ???:0
0x90ee14 c_parse_file()
        ???:0
0xa0d1b9 c_common_parse_file()
        ???:0

Reply via email to