- Notifications
You must be signed in to change notification settings - Fork 15.3k
Open
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerquality-of-implementation
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.
Metadata
Metadata
Assignees
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerquality-of-implementation