[PATCH] D54814: Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`.
Louis Dionne via Phabricator
reviews at reviews.llvm.org
Thu Nov 22 07:28:04 PST 2018
ldionne added a comment.
Please hold off with committing this until we've agreed on the ABI part. That'll take at least until next week when people are back from Thanksgiving.
================
Comment at: include/__config:1285
+#ifndef _LIBCPP_CXX03_LANG
+#define _LIBCPP_ALIGNOF(_Tp) alignof(_Tp)
+#elif defined(_LIBCPP_COMPILER_CLANG)
----------------
Can you indent nested `#define`s? I find it very difficult to read our PP code because it often lacks indentation.
================
Comment at: test/libcxx/libcpp_alignof.pass.cpp:29
+#ifdef TEST_COMPILER_CLANG
+ static_assert(_LIBCPP_ALIGNOF(T) == _Alignof(T), "");
+#endif
----------------
Why is this test useful? Isn't the previous one (for C++11) sufficient?
================
Comment at: test/support/test_macros.h:118
#else
-#define TEST_ALIGNOF(...) __alignof(__VA_ARGS__)
+#if defined(TEST_COMPILER_CLANG)
+# define TEST_ALIGNOF(...) _Alignof(__VA_ARGS__)
----------------
Why not always just `alignof`? Shouldn't we only use that macro in C++11 and above anyway?
Repository:
rCXX libc++
https://reviews.llvm.org/D54814
More information about the libcxx-commits
mailing list