[Bug libstdc++/88119] New: std::alignment_of returns wrong value (__alignof instead of alignof).

foom at fuhm dot net gcc-bugzilla@gcc.gnu.org
Tue Nov 20 18:26:00 GMT 2018


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

            Bug ID: 88119
           Summary: std::alignment_of returns wrong value (__alignof
                    instead of alignof).
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: foom at fuhm dot net
  Target Milestone: ---

std::alignment_of is currently defined based on "__alignof__", but according to
the standard [meta.unary.prop.query], it should return the same result as
"alignof".

And as of PR69560, __alignof and alignof now return different values in some
circumstances.

Test case for x86 with -m32, the static assert fails, but it should pass.

====
#include <type_traits>
static_assert(std::alignment_of<double>::value == alignof(double), "");


More information about the Gcc-bugs mailing list