[LLVMbugs] [Bug 16609] New: Expressions which result in bitfields are not properly promoted

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jul 12 11:39:20 PDT 2013


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

            Bug ID: 16609
           Summary: Expressions which result in bitfields are not properly
                    promoted
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dgjnadik at sharklasers.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 10876
  --> http://llvm.org/bugs/attachment.cgi?id=10876&action=edit
Code sample which should print 'signed' but prints 'unsigned'

While the direct addition of a bitfield and a signed integer correctly results
in a signed integer, an expression which yields a bitfield, as the conditional
operator is defined to if its operands are bitfields, has an extraneous
LValueToRValue conversion in the AST and casts the unsigned bitfield result to
an unsigned int before addition, resulting in an unsigned int instead of the
signed int expected by bitfield promotion rules.

-- 
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/20130712/8446cf34/attachment.html>


More information about the llvm-bugs mailing list