Skip to content

clang rejects default constexpr operator of a templated type when instantiated with non-constexpr comparable object #61238

@hanickadot

Description

@hanickadot

I was writing a generic code and found an issue with defaulted comparison operator if they are constexpr in a template, and then I instantiate it with non-constexpr comparable type. I think it should be accepted, especially if I write this code manually the constexpr-ness will be downgraded silently.

https://compiler-explorer.com/z/4fbasY6Pb

Metadata

Metadata

Assignees

Labels

c++23clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second party

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions