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

            Bug ID: 90284
           Summary: -Wunused-value points to the wrong expression
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: john.boyer at tutanota dot com
  Target Milestone: ---

In the following code https://godbolt.org/z/0jTk3e, GCC warns about the second
operand of a conditional expression having no effect, even though the second
operand is returned.

In reality, the first operand is the one that has no effect, not the second.

This only happens when a ternary is involved. If there is no ternary, the
proper warning is printed.

Reply via email to