This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/38087] g++ accepts invalid destructor call


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".

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]