Tool/software: TI C/C++ Compiler
// Code Fails enum class A : int { ONE = 1, TWO, THREE }; static_assert(static_cast<A>(1) == A::ONE,"ERROR"); // Code Passes enum class B { ONE = 1, TWO, THREE }; static_assert(static_cast<B>(1) == B::ONE,"ERROR");
The above code shows the bug. The following code also fails:
volatile auto var2 = static_cast<A>(1);
When a breakpoint is set on var2, the debugger shows the type as "Enum A" but the value is "0x0000" instead of the expected "ZN1A3ONEE"
This appears to be a compiler bug as MSP430 GCC and other mainstream compilers do not show this behavior.
Update:
Tested using the above code on a brand new project
Linux Commandline 18.1.4: Works
Linux CCS 8.2 - 18.1.4: Works
Windows CCS 8.2 - 18.1.3 + 18.1.4: Error
This appears to be a Windows CCS issue