Issue 137619
Summary clang++: wrong error about non-const member
Labels clang
Assignees
Reporter stsp
    ```
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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to