[Bug c++/105840] confusing diagnostic when naming the wrong class in a constructor

2022-06-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105840 --- Comment #4 from Jonathan Wakely --- For a destructor we do a bit better, but it could still be improved. struct A { ~A(); }; struct C { ~A(); }; 105840.C:14:3: error: declaration of ā€˜~A’ as member of ā€˜C’ 14 | ~A(); | ^

[Bug c++/105840] confusing diagnostic when naming the wrong class in a constructor

2022-06-03 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105840 --- Comment #3 from Marek Polacek --- Ah, that sounds great to me.

[Bug c++/105840] confusing diagnostic when naming the wrong class in a constructor

2022-06-03 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105840 --- Comment #2 from Barry Revzin --- I think something to this effect maybe? :9:7: error: attempting to declare constructor for unrelated class 'A'; did you mean to use 'B'? 9 | A(int i); | ^~ | B

[Bug c++/105840] confusing diagnostic when naming the wrong class in a constructor

2022-06-03 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105840 Marek Polacek changed: What|Removed |Added Ever confirmed|0 |1 Keywords|