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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
            Summary|Internal compiler error:    |[C++20] ICE with use of
                   |../csu/libc-start.c:392     |function template name with
                   |                            |no prior declaration in
                   |                            |decltype
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-07-03
      Known to fail|                            |14.0, 9.5.0

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed, fully reduced testcase:
```
template <typename... Ts> struct tuple {};
template <int... Ts> struct seq {};
template <typename TT, typename... Ts, int... i>
inline auto sfinae_friendly_apply_impl(TT invocable, tuple<Ts...> t, 
seq<i...>) noexcept
    -> decltype(invocable(get<i>(t)...)) {}
void run_all() {
  sfinae_friendly_apply_impl([](){}, tuple<>{}, seq<>{});
}
template<int i, typename T> int get(T);

```

Note moving the definition of get before the definition of
sfinae_friendly_apply_impl allows GCC to work.

Reply via email to