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

           Summary: clang should warn if 'else if' clause is same as any
                    previous 'if' clause
           Product: new-bugs
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Consider the following C snippit:

    if (x == 5)
    {
        ...
    }
    else if (x == 5)
    {
        ...
    }

I've made a typo in the 'else if' and accidentally tested condition.

It would be nice it clang could warn when it sees this.

With raw ints it's easy to see the mistake, but when they are constants, and
two constants accidentally have the same value, it's harder to find.

It would be happy with this in either the compiler or static analyzer.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to