[Bug c++/89781] Misleading error messages when initializing a static data member in-class
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89781 Andrew Pinski changed: What|Removed |Added Last reconfirmed||2021-07-29 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #4 from Andrew Pinski --- Confirmed, the error message definitely can be improved.
[Bug c++/89781] Misleading error messages when initializing a static data member in-class
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89781 --- Comment #3 from Mathias Stearn --- Yeah, my point wasn't that this code should be accepted, it was that the error messages should be improved. Ideally there would even be fixits suggesting adding constexpr where it would be valid, otherwise suggesting inline. Sorry if that wasn't clear.
[Bug c++/89781] Misleading error messages when initializing a static data member in-class
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89781 --- Comment #2 from Jonathan Wakely --- Yeah I guess the diagnostics could be improved for C++17 and up to say that using 'inline' would make it valid.
[Bug c++/89781] Misleading error messages when initializing a static data member in-class
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89781 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek --- Why do you think so? Inline variables in C++17 are only variables with explicit inline keyword or constexpr static data members. So it is correct this is rejected. Are you suggesting the diagnostics should say something like either 'constexpr' needed ... or static data member needs to be 'inline' ?