[Bug c++/100588] Destroying delete shouldn't be called if constructor throws

2024-07-24 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100588

Jason Merrill  changed:

   What|Removed |Added

   Target Milestone|--- |12.0
 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Jason Merrill  ---
Fixed in GCC 12.

[Bug c++/100588] Destroying delete shouldn't be called if constructor throws

2022-02-02 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100588

Jason Merrill  changed:

   What|Removed |Added

  Known to work||12.0

--- Comment #2 from Jason Merrill  ---
Fixed for GCC 12 so far.

[Bug c++/100588] Destroying delete shouldn't be called if constructor throws

2022-01-07 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100588

--- Comment #1 from CVS Commits  ---
The master branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:75047f79550fd10a8f86f5c72deab10cde77

commit r12-6380-g75047f79550fd10a8f86f5c72deab10cde77
Author: Jason Merrill 
Date:   Thu Jan 6 13:26:21 2022 -0500

c++: destroying delete, throw in new-expr [PR100588]

The standard says that a destroying operator delete is preferred, but that
only applies to the delete-expression, not the cleanup if a new-expression
initialization throws.  As a result of this patch, several of the
destroying
delete tests don't get EH cleanups, but I'm turning off the warning in
cases
where the initialization can't throw anyway.

It's unclear what should happen if the class does not declare a
non-deleting
operator delete; a proposal in CWG was to call the global delete, which
makes sense to me if the class doesn't declare its own operator new.  If it
does, we warn and don't call any deallocation function if initialization
throws.

PR c++/100588

gcc/cp/ChangeLog:

* call.c (build_op_delete_call): Ignore destroying delete
if alloc_fn.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/destroying-delete5.C: Expect warning.
* g++.dg/cpp2a/destroying-delete6.C: New test.

[Bug c++/100588] Destroying delete shouldn't be called if constructor throws

2022-01-06 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100588

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||jason at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org

[Bug c++/100588] Destroying delete shouldn't be called if constructor throws

2021-05-13 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100588

Jonathan Wakely  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Keywords||wrong-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-05-13