public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/108303] New: lookup failes with requires clause on non-template friend function of a class template
@ 2023-01-05 17:20 ted at lyncon dot se
  2023-01-05 17:45 ` [Bug c++/108303] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ted at lyncon dot se @ 2023-01-05 17:20 UTC (permalink / raw)
  To: gcc-bugs

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
}
```

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-09 21:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-05 17:20 [Bug c++/108303] New: lookup failes with requires clause on non-template friend function of a class template ted at lyncon dot se
2023-01-05 17:45 ` [Bug c++/108303] " redi at gcc dot gnu.org
2023-01-06  6:35 ` pinskia at gcc dot gnu.org
2023-05-09 21:27 ` ppalka at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).