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

--- Comment #39 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to r...@cebitec.uni-bielefeld.de from comment #37)
>   AFAICS, alignof is C++ >= 11 only.  I've used the attached patch to
>   use __alignof__ instead, although I don't know if that's the best fix.

Yes, alignof is C++11 only, but the reason it's OK to use there is that
__STDCPP_DEFAULT_NEW_ALIGNMENT__ is C++17 only, and alignof is guarded by:

#if __cpp_aligned_new
        if (alignof(_Tp) > __STDCPP_DEFAULT_NEW_ALIGNMENT__)

Strictly speaking, this code is enabled when -faligned-new is active, which is
true for C++17 by default.

It appears that Jakub's patch makes -faligned-new always active for Solaris
x86, which we don't want.

Reply via email to