Skip to content
Snippets Groups Projects
Commit 7ca21601 authored by Jason Merrill's avatar Jason Merrill
Browse files

c++: new (nothrow) array cleanup [PR104007]

For this testcase, the cleanup that is supposed to happen if initialization
throws was wrongly being run on the normal control path as well.  This turns
out to be because the EH-only handling in gimple_push_cleanup didn't apply
to conditional cleanups such as we have for nothrow new, since we check
whether the result is non-null before proceeding with the initialization.

	PR c++/104007

gcc/ChangeLog:

	* gimplify.cc (gimple_push_cleanup): Handle eh_only in conditional
	context.

gcc/testsuite/ChangeLog:

	* g++.dg/eh/new2.C: New test.
parent 3a0837b8
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment