[LLVMbugs] [Bug 8142] New: implement -Wenum-compare

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Sep 13 17:07:25 PDT 2010


           Summary: implement -Wenum-compare
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nlewycky at google.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

Clang does not emit a warning on this code:

  enum X { Ax, Bx };
  enum Y { Ay, By };

  int foo(enum X x, enum Y y) {
    return x == y;

while GCC does:

  enum.cc: In function ‘int foo(X, Y)’:
  enum.cc:5: warning: comparison between ‘enum X’ and ‘enum Y’

This is under -Wenum-compare in GCC.

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