[LLVMbugs] [Bug 9952] New: Warn on identical subexpressions to the left and right of ||, &&

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu May 19 09:59:53 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=9952

           Summary: Warn on identical subexpressions to the left and right
                    of ||, &&
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu


http://www.viva64.com/ru/pvs-studio/ seems to warn on this code:

void f() {
  int a0 = 0, a1 = 1;
  if (a0 == 0 || a0 == 0)
    a1 = 2;
}

It says something along the lines of "There are identical sub-expressions to
the left and to the right of the '||' operator."

Can / should clang do this, too?

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list