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

c++: TARGET_EXPR_ELIDING_P and std::move [PR107267]

With -ffold-simple-inlines, we turn calls to std::move into the static_cast
equivalent.  In this testcase, this exposes the FindResult temporary to copy
elision which is not specified by the standard, through an optimization in
gimplify_modify_expr_rhs.  Since the type is not TREE_ADDRESSABLE, this is
not detectable by the user, so we just need to soften the assert.

	PR c++/107267

gcc/cp/ChangeLog:

	* cp-gimplify.cc (cp_gimplify_init_expr): Allow unexpected elision
	of trivial types.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/move2.C: New test.
parent 51767f31
No related branches found
No related tags found
Loading
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