Tool/software: TI C/C++ Compiler
Hello. I am using TI ARM Compiler v18.1.1 LTS which supports c++14 and constexpr to compile the code:
class MyClass { public: constexpr MyClass (const char* str) : mystr() { mystr[0] = 1; } private: char mystr[16]; }; constexpr MyClass A("This is a constant literal");
The compiler throws the error at the last line:
#28 expression must have a constant value test.hpp
There is no problem if i remove the assignment inside the constructor. Also it compiles fine if i make the constructor empty and leave the assignment.
I was testing that code with x86 GCC 5.3.0 and it compiles fine.