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

2018-06-20 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38087

Jonathan Wakely  changed:

   What|Removed |Added

 CC||zhonghao at pku dot org.cn

--- Comment #7 from Jonathan Wakely  ---
*** Bug 86225 has been marked as a duplicate of this bug. ***

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

2018-06-20 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38087

Jonathan Wakely  changed:

   What|Removed |Added

 CC||su at cs dot ucdavis.edu

--- Comment #8 from Jonathan Wakely  ---
*** Bug 71765 has been marked as a duplicate of this bug. ***

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

2018-05-18 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38087

Eric Gallager  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=12333
Summary|Pseudo destructor call  |g++ accepts invalid
   ||destructor call

--- Comment #5 from Eric Gallager  ---
(In reply to Eric Gallager from comment #4)
> Redoing lost comments:
> 
> https://gcc.gnu.org/ml/gcc-bugs/2017-08/msg01624.html
> 
> Eric Gallager  changed:
> 
>What|Removed |Added
> 
>  Status|UNCONFIRMED |WAITING
>Last reconfirmed||2017-08-14
>  CC||egallager at gcc dot gnu.org
>  Ever confirmed|0   |1
> 
> --- Comment #4 from Eric Gallager  ---
> (In reply to Andrew Pinski from comment #1)
> > I still think this is valid code ...  There are defect reports against this
> > area too.
> 
> Which ones do you mean?
> 
> https://gcc.gnu.org/ml/gcc-bugs/2017-08/msg01637.html
> 
> Jonathan Wakely  changed:
> 
>What|Removed |Added
> 
>Keywords||accepts-invalid
>  Status|WAITING |NEW
> 
> --- Comment #5 from Jonathan Wakely  ---
> There's https://wg21.link/cwg555 but I don't think it changes anything here.
> 
> [expr.pseudo] definitely doesn't apply, as that only applies to non-class
> types. (The bug title is wrong for the same reason, this is a destructor
> call, not a pseudo destructor call.)
> 
> The current wording in [basic.lookup.classref] says "At least one of the
> lookups shall find a name that refers to cv T." The object expression has
> type C, but the lookup result for B does not find that type, so the code is
> invalid.

Retitling then.

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

2018-05-18 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38087

Jonathan Wakely  changed:

   What|Removed |Added

   Last reconfirmed|2017-08-17 00:00:00 |2018-5-18

--- Comment #6 from Jonathan Wakely  ---
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".