https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108303
Bug ID: 108303 Summary: lookup failes with requires clause on non-template friend function of a class template Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ted at lyncon dot se Target Milestone: --- This works up to 12.2 (inclusive) on godbolt but fails on trunk: ``` template <typename Derived> struct base { friend void foo(const Derived& d) requires requires { bar(d); } // removing this makes it work { bar(d); } }; namespace adl { struct S : base<S> { friend void bar(const S&) {} }; } // namespace adl void test(adl::S const& s) { foo(s); // error: 'foo' was not declared in this scope } ```