[Bug c++/60202] < 128 alignment for vector<T> data where T has a member with alignas(128)

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Jan 31 00:11:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60202

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |msebor at gcc dot gnu.org
         Resolution|---                         |DUPLICATE

--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
I believe this can be classified as a duplicate of bug 36159, which asks to add
a warning pointing out this loophole in C++.

The underlying problem is that standard containers like vector are required to
use the standard allocator which in turn is required to use the default
operator new to allocate memory, which provides no interface to specify the
alignment of the type being allocated.

If the C++ proposal for the Dynamic Memory Allocation For Over-aligned Data is
accepted and implemented then it will become possible to use standard
containers with overaligned types:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0035r0.html

*** This bug has been marked as a duplicate of bug 36159 ***


More information about the Gcc-bugs mailing list