[LLVMbugs] [Bug 14412] New: bool reduction of case values is questionable

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Nov 22 03:14:03 PST 2012


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

             Bug #: 14412
           Summary: bool reduction of case values is questionable
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: joerg at NetBSD.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Test case:

void a (void) {
    _Bool b;
    switch (b) {
    case 2:
    case 0:
    break;
    }
}

This gives a warning: overflow converting case value to switch condition type
(2 to 0)
and later an error for the defined case. I don't think the warning is correct.

-- 
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