PR c++/86485 - -Wmaybe-unused with empty class ?:
authorJason Merrill <jason@redhat.com>
Tue, 5 Mar 2019 22:20:41 +0000 (17:20 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 5 Mar 2019 22:20:41 +0000 (17:20 -0500)
commit507318f109624f58d4bf554c3ad284cdf09324e3
tree49ed38aa621b2eab775ddb3e1339416da189332f
parentdbcd32f889365695b3ed835a3a7de5d23048f43b
PR c++/86485 - -Wmaybe-unused with empty class ?:

The problem in this testcase is that the front end expects an rvalue
COND_EXPR to initialize a single temporary from one of the arms.  But
because gimplify_cond_expr used MODIFY_EXPR, instead the arms would each
create their own temporary and then copy that into the common temporary.

So, let's use INIT_EXPR instead.

* gimplify.c (gimplify_cond_expr): Use INIT_EXPR.

From-SVN: r269403
gcc/ChangeLog
gcc/gimplify.c
gcc/testsuite/g++.dg/init/empty2.C [new file with mode: 0644]