[libcxx-commits] [PATCH] D126249: [libc++] Remove _LIBCPP_ALIGNOF

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 6 08:10:33 PDT 2022


ldionne added a comment.

In D126249#3543962 <https://reviews.llvm.org/D126249#3543962>, @philnik wrote:

>> - If the compiler ever wants to support `alignof` as an extension in C++03, we'll need coordination between the library and the compiler.
>
> That could be avoided by checking for `#if defined(_LIBCPP_CXX03_LANG) && !__has_keyword(alignof)` instead of just `#ifdef _LIBCPP_CXX03_LANG`.

Fair point.

>> - This breaks the symmetry between `_LIBCPP_PREFERRED_ALIGNOF` and `_LIBCPP_ALIGNOF`.
>
> There are exactly 3 uses of `_LIBCPP_PREFERRED_ALIGNOF`, all of which are in `<type_traits>`. I think removing the macro and adding a comment on these places is the better alternative.

Can you upload a patch that does this before we decide whether to move forward with this patch?

> I know we don't want to break users, but I think we should treat C++03 as what it is: A relic of a bygone era and a burden nobody wants to keep.

I agree that C++03 is a relic, and I agree that we want to get rid of it. However, I think you are underestimating how many users of it there are. For example, AppleClang still uses C++03 by default today because we've run into issues when flipping the default -- LLVM Clang uses C++14 AFAICT. It doesn't change much w.r.t. this patch, but I think it's important to be aware that a lot of users unfortunately still compile as C++03.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126249/new/

https://reviews.llvm.org/D126249



More information about the libcxx-commits mailing list