r278945 - in /trunk/gcc: cp/ChangeLog cp/conste...

jakub@gcc.gnu.org jakub@gcc.gnu.org
Tue Dec 3 19:27:00 GMT 2019


Author: jakub
Date: Tue Dec  3 19:27:47 2019
New Revision: 278945

URL: https://gcc.gnu.org/viewcvs?rev=278945&root=gcc&view=rev
Log:
	PR c++/91369
	* constexpr.c (struct constexpr_global_ctx): Add cleanups member,
	initialize it in the ctor.
	(cxx_eval_constant_expression) <case TARGET_EXPR>: If TARGET_EXPR_SLOT
	is already in the values hash_map, don't evaluate it again.  Put
	TARGET_EXPR_SLOT into hash_map even if not lval, and push it into
	save_exprs too.  If there is TARGET_EXPR_CLEANUP and not
	CLEANUP_EH_ONLY, push the cleanup to cleanups vector.
	<case CLEANUP_POINT_EXPR>: Save outer cleanups, set cleanups to
	local auto_vec, after evaluating the body evaluate cleanups and
	restore previous cleanups.
	<case TRY_CATCH_EXPR>: Don't crash if the first operand is NULL_TREE.
	(cxx_eval_outermost_constant_expr): Set cleanups to local auto_vec,
	after evaluating the expression evaluate cleanups.

	* g++.dg/cpp2a/constexpr-new8.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-new8.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/constexpr.c
    trunk/gcc/testsuite/ChangeLog



More information about the Gcc-cvs mailing list