[LLVMbugs] [Bug 3648] New: clang gives @encode a different type from gcc ( and related issues)

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Feb 22 04:24:43 PST 2009


           Summary: clang gives @encode a different type from gcc (and
                    related issues)
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: sharparrow1 at yahoo.com
                CC: llvmbugs at cs.uiuc.edu

Per summary; testcase:

int a[sizeof(@encode(int)) == 2 ? 1 : -1]; // Type is char[2]
char b[] = @encode(int); // Initialize like a string
char (*c)[2] = &@encode(int); // @encode is an lvalue

I'm not sure whether the differences here are intentional or not... there isn't
any standards document to refer to here :)  I don't see any good reason to be
incompatible with gcc here, though.

That said, I'm guessing these sort of constructs aren't common, considering
that nobody has complained about it yet.  (I haven't seen this in real-world
code; I was just trying it out of curiosity.)

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