https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77922
Bug ID: 77922
Summary: Bogus suggestion: ‘constexpr’ does not name a type;
did you mean ‘constexpr’?
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
Target Milestone: ---
constexpr int a = 1;
with -std=c++98 gives
pr.C:1:1: error: ‘constexpr’ does not name a type; did you mean ‘constexpr’?
constexpr int a = 1;
^~~~~~~~~
constexpr
pr.C:1:1: note: C++11 ‘constexpr’ only available with -std=c++11 or
-std=gnu++11
I'd say we should just not print the bogus "did you mean" if the identifier
fuzzy matching found is the same as the one used originally. Or not add
constexpr into the suggestions in this case because it is not C++98?