Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

constexpr not allowed on member function of type with a virtual base. #112016

Open
i-photon opened this issue Oct 11, 2024 · 4 comments
Open

constexpr not allowed on member function of type with a virtual base. #112016

i-photon opened this issue Oct 11, 2024 · 4 comments
Labels
c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party constexpr Anything related to constant evaluation rejects-valid

Comments

@i-photon
Copy link

Virtual constexpr has been allowed since C++20.
What happened?

Here's my sentiment: https://godbolt.org/z/f8hYGYMab

This is causing a needless headache trying to re-use interfaces in constexpr.

@cor3ntin cor3ntin added c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema" constexpr Anything related to constant evaluation rejects-valid confirmed Verified by a second party and removed new issue labels Oct 11, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 11, 2024

@llvm/issue-subscribers-clang-frontend

Author: None (i-photon)

Virtual constexpr has been allowed since C++20. What happened?

Here's my sentiment: https://godbolt.org/z/f8hYGYMab

This is causing a needless headache trying to re-use interfaces in constexpr.

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 11, 2024

@llvm/issue-subscribers-c-20

Author: None (i-photon)

Virtual constexpr has been allowed since C++20. What happened?

Here's my sentiment: https://godbolt.org/z/f8hYGYMab

This is causing a needless headache trying to re-use interfaces in constexpr.

@cor3ntin
Copy link
Contributor

The restriction only applies to structors https://eel.is/c++draft/dcl.dcl#dcl.constexpr-3

@frederick-vs-ja
Copy link
Contributor

Looks like a duplicate of #97266.

Virtual constexpr has been allowed since C++20.

This is unrelated to virtual base classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party constexpr Anything related to constant evaluation rejects-valid
Projects
None yet
Development

No branches or pull requests

4 participants