-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed as not planned
Closed as not planned
Copy link
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"constexprAnything related to constant evaluationAnything related to constant evaluationinvalidResolved as invalid, i.e. not a bugResolved as invalid, i.e. not a bugundefined behaviour
Description
Hi experts,
I'm updating the clang version from 20 to 21 and see the new error in my project.
The error is introduced from a third-party library and I reduce the code size to a minimum issue.
Please check the compiler-explorer, https://godbolt.org/z/x73rfhWfW
Seems that static member variable must be a constant expression.
However, in this case, type(BOUND+1) is not a constant expression in clang21 but I think it should be considered as a constant expression.
I have some workaround for it but I don't want to do that because it's a third party library.
Is it possible to support this code?
struct Test {
enum type {
Type1,
BOUND
};
static const type binding_required = BOUND;
static const type binding_completed = type(BOUND+1);
static const type detached = type(binding_completed+1);
static const type dying = type(detached+1);
};
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"constexprAnything related to constant evaluationAnything related to constant evaluationinvalidResolved as invalid, i.e. not a bugResolved as invalid, i.e. not a bugundefined behaviour