https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86485

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Tue Mar  5 22:20:41 2019
New Revision: 269403

URL: https://gcc.gnu.org/viewcvs?rev=269403&root=gcc&view=rev
Log:
        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.

Added:
    trunk/gcc/testsuite/g++.dg/init/empty2.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimplify.c

Reply via email to