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

            Bug ID: 22279
           Summary: alignment specifier ignored on enum definitions
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

Consider:

  enum alignas(64) X : int {} x;
  static_assert(alignof(X) == 64, "");

This fails: the assert fires, and if you remove it, we generate code that has
an underaligned global 'x'.

Same thing happens for __attribute__((aligned(N))) (but in that case, we're at
least being GCC-compatible).

Conversely, consider:

  typedef __attribute__((aligned(64))) N;
  enum X : N {} x;

Here, we *do* apply the alignment to X. It's not obvious whether we should. GCC
does. EDG does not.

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