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

            Bug ID: 118604
           Summary: gcc/cp/parser.cc:51316: Non clear code produces clang
                    warning
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

clang says:

gcc/cp/parser.cc:51316:11: warning: logical not is only applied to the left
hand side of this comparison [-Wlogical-not-parentheses]

Source code is

  if (!strcmp (p, "when") == 0 && !default_p)

Maybe better code:

  if (strcmp (p, "when") != 0 && !default_p)

Reply via email to