[LLVMbugs] [Bug 16200] New: False positives due to unevaluated ternary expression

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jun 2 18:52:30 PDT 2013


            Bug ID: 16200
           Summary: False positives due to unevaluated ternary expression
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: matthew at dempsky.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This code triggers a "warning: shift count >= width of type
[-Wshift-count-overflow]" warning with Clang 3.3rc2:

    int x = 1 ? 0 : (1 << 100);

However, it should be possible to identify that the 1 << 100 expression is
never evaluated, and therefore the warning is unnecessary.

For comparison, GCC 4.2 avoids outputting a warning for the above code, though
it also warns about shift count >= width of type.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130603/3d8006a4/attachment.html>

More information about the llvm-bugs mailing list