[Bug libstdc++/61458] New: std::aligned_storage is bigger than expected

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jun 9 20:30:00 GMT 2014


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

            Bug ID: 61458
           Summary: std::aligned_storage is bigger than expected
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org

#include <type_traits>

static_assert(sizeof(std::aligned_storage<4>::type) == 4, "");


so.cc: In function ‘int main()’:
so.cc:5:3: error: static assertion failed: 
   static_assert(sizeof(std::aligned_storage<4>::type) == 4, "");
   ^


I think this is conforming, but it would be more useful if it passed.

We use the maximum alignment supported for any type, where we should use the
maximum alignment supported for types less than 4 bytes


More information about the Gcc-bugs mailing list