[llvm-bugs] [Bug 42396] New: Alignment not respected in containers for over-aligned enumeration types

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 25 14:45:33 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42396

            Bug ID: 42396
           Summary: Alignment not respected in containers for over-aligned
                    enumeration types
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mclow.lists at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

Created attachment 22140
  --> https://bugs.llvm.org/attachment.cgi?id=22140&action=edit
Reproducer

Inspired by:
https://stackoverflow.com/questions/56760874/discrepancy-in-c-between-over-aligned-struct-and-enum-within-container

Given an enumeration type with a specified alignment, the elements in a vector
of such a type should be aligned correctly. This appears not to be the case -
and can lead to UBSAN going off.


In the reproducer, I also check the size of a 16-element array of these two
types.
Clang says they're different sizes - that suggests to me that there's a clang
problem here. 

The alignment in the containers bit could be related to
https://bugs.llvm.org/show_bug.cgi?id=22634. (might even be the same bug)

-- 
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/20190625/e2476905/attachment.html>


More information about the llvm-bugs mailing list