Work harder to avoid -Wuninitialized for objects of empty structs (PR middle-end...
authorMartin Sebor <msebor@redhat.com>
Wed, 16 Sep 2020 19:23:31 +0000 (13:23 -0600)
committerMartin Sebor <msebor@redhat.com>
Wed, 16 Sep 2020 19:23:31 +0000 (13:23 -0600)
commit8b75204b27cb2a296ac329d48918992b4053c61e
treed18e80f2199b59b8790a01df3e62b8a058e875ad
parent8155316c6fc23045e8e056e91449a6e9863c357f
Work harder to avoid -Wuninitialized for objects of empty structs (PR middle-end/96295).

Resolves:
PR middle-end/96295 - -Wmaybe-uninitialized warning for range operator with
reference to an empty struct

gcc/ChangeLog:

PR middle-end/96295
* tree-ssa-uninit.c (maybe_warn_operand): Work harder to avoid
warning for objects of empty structs

gcc/testsuite/ChangeLog:

PR middle-end/96295
* g++.dg/warn/Wuninitialized-11.C: New test.
gcc/testsuite/g++.dg/warn/Wuninitialized-11.C [new file with mode: 0644]
gcc/tree-ssa-uninit.c