[Bug c++/119191] Add fix-it for missing argument list in operator()

2025-03-10 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119191 --- Comment #1 from Jonathan Wakely --- Clang is no better, it also just says "that's wrong" without a fix-it: callop.cc:2:8: error: 'operator()' cannot be the name of a variable or data member 2 | void operator(); |^ callop

[Bug c++/119191] Add fix-it for missing argument list in operator()

2025-03-10 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119191 --- Comment #3 from Jonathan Wakely --- The 'operator(int)' case is interesting because it could be a typo for several other operators, operator+(int) or operator++(int) or operator[](int). Personally, I know that I forget the double parens for

[Bug c++/119191] Add fix-it for missing argument list in operator()

2025-03-10 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119191 --- Comment #4 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #0) > callop.cc:3:16: error: expected type-specifier before ‘(’ token > 3 | void operator(int, int); > |^ Oops, I posted the output fr

[Bug c++/119191] Add fix-it for missing argument list in operator()

2025-03-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119191 Andrew Pinski changed: What|Removed |Added Last reconfirmed||2025-03-10 Ever confirmed|0

[Bug c++/119191] Add fix-it for missing argument list in operator()

2025-03-10 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119191 --- Comment #2 from Jonathan Wakely --- EDG is almost there: "callop.cc", line 2: error: an operator name must be declared as a function void operator(); ^ "callop.cc", line 3: error: expected an operator void operator(int);