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

             Bug #: 13646
           Summary: No error about changing const variable via
                    struct/union copy
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


union foo {
    int a;
    const int b;
};

int main(void)
{
    union foo f1, f2;

    f1.a = 5;
    f2 = f1;
    return 0;
}

gcc fails:

test2.c:11:2: error: assignment of read-only variable ‘f2’

clang gives no error.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to