Open
Description
class A {
static const char *aaa = "aaa";
};
clang++:
cstr.cpp:2:24: error: non-const static data member must be initialized out of line
2 | static const char *aaa = "aaa";
This error is absolutely wrong
and misleading. I had to use gcc
to get a clue:
g++:
cstr.cpp:2:24: error: ‘constexpr’ needed for in-class initialization of static data member ‘const char* A::aaa’ of non-integral type [-fpermissive]
2 | static const char *aaa = "aaa";
Perfectly clear and valid msg.