[Bug c++/86485] [7/8 Regression] "anonymous" maybe-uninitialized false positive with ternary operator

2019-11-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86485

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|7.5 |8.4

--- Comment #8 from Richard Biener  ---
The GCC 7 branch is being closed, re-targeting to GCC 8.4.

[Bug c++/86485] [7/8 Regression] "anonymous" maybe-uninitialized false positive with ternary operator

2019-05-22 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86485

--- Comment #7 from Jason Merrill  ---
Author: jason
Date: Wed May 22 19:48:05 2019
New Revision: 271521

URL: https://gcc.gnu.org/viewcvs?rev=271521=gcc=rev
Log:
PR c++/86485 - simple_empty_class_p

Yet another tweak that would have fixed this bug: we should treat INIT_EXPR
and MODIFY_EXPR differently for determining whether this is a simple empty
class copy, since a TARGET_EXPR on the RHS is direct initialization if
INIT_EXPR but copy if MODIFY_EXPR.

* cp-gimplify.c (simple_empty_class_p): Also true for MODIFY_EXPR.

Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-gimplify.c

[Bug c++/86485] [7/8 Regression] "anonymous" maybe-uninitialized false positive with ternary operator

2019-05-07 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86485

--- Comment #6 from Jason Merrill  ---
Author: jason
Date: Tue May  7 22:37:19 2019
New Revision: 270985

URL: https://gcc.gnu.org/viewcvs?rev=270985=gcc=rev
Log:
PR c++/86485 - -Wmaybe-unused with empty class ?:

* typeck.c (build_static_cast_1): Use cp_build_addr_expr.

For GCC 9 I fixed this bug with a patch to gimplify_cond_expr, but this
function was also doing the wrong thing.

Using build_address does not push the ADDR_EXPR down into the arms of a
COND_EXPR, which we need for proper handling of conversion of an lvalue ?:
to another reference type.

Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/typeck.c

[Bug c++/86485] [7/8 Regression] "anonymous" maybe-uninitialized false positive with ternary operator

2019-03-05 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86485

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org
Summary|[7/8/9 Regression]  |[7/8 Regression]
   |"anonymous" |"anonymous"
   |maybe-uninitialized false   |maybe-uninitialized false
   |positive with ternary   |positive with ternary
   |operator|operator

--- Comment #5 from Jason Merrill  ---
Fixed on trunk so far.