[Bug c++/43253] improve diagnostics for invalid pseudo destructor call
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43253 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed||2021-07-16 --- Comment #3 from Jonathan Wakely --- Now we say: 43253.C: In function 'int main()': 43253.C:4:13: error: expected identifier before 'int' 4 | x->~int(); | ^~~ I suppose we could add a more specific diagnostic saying you can't do this. It's not a high priority, because the code is nonsense anyway. Why would you want to destroy an int explicitly? A pseudo-destructor call is only useful in generic code where you don't know what the type is.
[Bug c++/43253] improve diagnostics for invalid pseudo destructor call
--- Comment #2 from manu at gcc dot gnu dot org 2010-03-04 18:22 --- REOPENing as a diagnostic enhancement. I know that the quality of the diagnostics from the parser is not a top priority but I still hop that someone may someday improve this a little. And this error could be so much clear... -- manu at gcc dot gnu dot org changed: What|Removed |Added CC||manu at gcc dot gnu dot org Severity|normal |enhancement Status|RESOLVED|UNCONFIRMED Keywords||diagnostic Resolution|INVALID | Summary|g++ chokes on pseudo|improve diagnostics for |destructor call |invalid pseudo destructor ||call http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43253