[LLVMbugs] [Bug 13809] New: IRGen failure with conditional operator which produces an lvalue bitfield

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Sep 10 14:39:33 PDT 2012


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

             Bug #: 13809
           Summary: IRGen failure with conditional operator which produces
                    an lvalue bitfield
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Clang dies on this:

struct S { int x : 5, y : 9; };
void f(bool c, S &a) { (c ? a.x : a.y) = 4; }

... saying:

<stdin>:2:31: error: cannot compile this conditional operator yet
void f(bool c, S &a, S &b) { (c ? a.x : a.y) = 4; }
                              ^~~~~~~~~~~~~

We're also getting Sema wrong for this case. We accept:

int &g(bool c, S &a, S &b) { return (c ? a.x : a.y); }

... but we should not, because it binds a reference to a bitfield.

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