https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103923
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- Here's a minimal program showing the underlying problem: template<typename T, bool x = noexcept(T{}())> struct C { }; struct T { struct H { auto operator()() const { return 0; } }; C<H> c; }; T t; 103923.C:1:43: error: use of 'auto T::H::operator()() const' before deduction of 'auto' 1 | template<typename T, bool x = noexcept(T{}())> | ~~~^~ 103923.C:10:12: error: template argument 2 is invalid 10 | C<H> c; | ^