[LLVMbugs] [Bug 4027] New: compound literals rejected in strange way

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Apr 20 22:02:41 PDT 2009


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

           Summary: compound literals rejected in strange way
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: clattner at apple.com
                CC: llvmbugs at cs.uiuc.edu


This compiles fine:
struct a { int x, y };
struct a V = (struct a){ 1, 2};

This does is rejected by sema:
struct a { int x, y };
const struct a V = (struct a){ 1, 2};

t.c:4:20: error: initializer element is not a compile-time constant
const struct a V = (struct a){ 1, 2};
                   ^~~~~~~~~~~~~~~~~


Huh?


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