[LLVMbugs] [Bug 22279] New: alignment specifier ignored on enum definitions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jan 20 18:24:01 PST 2015


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: unassignedclangbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150121/e3219e8a/attachment.html>


More information about the llvm-bugs mailing list