You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code is undefined behavior in C++17. And undefined behavior is not allowed in constant expressions - the compiler is required to diagnose it. Adapted from cppreference:
enum foo { a = 0, b = 1 };
constexpr foo x = static_cast(123); // undefined behavior since C++17