https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106026
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Reduced to: ``` struct k { template <typename CPO, typename... Args> auto operator()(CPO cpo, Args &&...args) const -> decltype(tag_invoke(cpo, args...)) { return tag_invoke(cpo, args...); } }; k j{}; struct nn { template <class T> friend void tag_invoke(nn, T &&) { } auto operator()(auto x) const { return j(*this, x); } }; constexpr nn h; template <class T> concept has_extents = requires(T t) { h(t); }; template <has_extents T> constexpr void tag_invoke(nn, T &&) {} static_assert(has_extents<int>); ```