public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/103865] New: virtual function can have a requires clause
@ 2021-12-30  9:57 fchelnokov at gmail dot com
  2021-12-30 10:03 ` [Bug c++/103865] " pinskia at gcc dot gnu.org
  2022-05-24  8:23 ` redi at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: fchelnokov at gmail dot com @ 2021-12-30  9:57 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103865
           Summary: virtual function can have a requires clause
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fchelnokov at gmail dot com
  Target Milestone: ---

A virtual function cannot have a requires clause, but GCC allows it to have:
```
struct A {
    virtual void foo() {}
};

template<class T>
struct B : A {
    void foo() requires true {}
};

int main() {
    B<void> b;
}

```
Both Clang and MSVC refuse to accept it. Demo:
https://gcc.godbolt.org/z/fEj6Wq53E

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

end of thread, other threads:[~2022-05-24  8:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-30  9:57 [Bug c++/103865] New: virtual function can have a requires clause fchelnokov at gmail dot com
2021-12-30 10:03 ` [Bug c++/103865] " pinskia at gcc dot gnu.org
2022-05-24  8:23 ` redi 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).