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

            Bug ID: 126715
           Summary: Add new warning for a == 10 ? false : true called
                    -Wredundant-ternary.
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kaelfandrew at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/eTzvfjc7d

GCC trunk with -O3 -Wall -Wextra does not warn that the C/C++ ternary is
redundant.

```
extern bool src (int a);

bool
src (int a)
{
  return a == 10 ? false : true;
}

```

This shows up in GCC pre r17-2872.

Reply via email to