This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/38087] g++ accepts invalid destructor call
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 18 May 2018 12:09:40 +0000
- Subject: [Bug c++/38087] g++ accepts invalid destructor call
- Auto-submitted: auto-generated
- References: <bug-38087-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38087
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2017-08-17 00:00:00 |2018-5-18
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Clang gives this error:
d.cc:4:11: error: destructor type 'B' in object destruction expression does not
match the type 'C' of the object being destroyed
this->~B();
^
d.cc:1:7: note: type 'B' is declared here
class B { };
^
1 error generated.
And EDG gives this error:
"d.cc", line 4: error: invalid destructor name for type "C"
this->~B();
^
1 error detected in the compilation of "d.cc".