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

           Summary: initializer element is not a compile-time constant
                    (address of variable)
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Revision 66878

The following code is rejected by clang ("initializer element is not a
compile-time constant"):

> cat controls.c
typedef struct {
  int first_def;
} BAR;

static int foo;

BAR table[] = { {(int)&foo} };

> gcc -fsyntax-only controls.c
> clang -fsyntax-only controls.c
controls.c:7:15: error: initializer element is not a compile-time constant
BAR table[] = { {(int)&foo} };
              ^~~~~~~~~~~~~~~
1 diagnostic generated.


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