[libcxx-commits] [libcxx] [libc++] Fix __datasizeof_v for Clang17 and 18 in C++03 (PR #106832)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 3 10:33:50 PDT 2024


================
@@ -26,34 +26,22 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if __has_keyword(__datasizeof) || __has_extension(datasizeof)
+// TODO: Enable this again once #94816 is fixed.
+#if (__has_keyword(__datasizeof) || __has_extension(datasizeof)) && 0
 template <class _Tp>
 inline const size_t __datasizeof_v = __datasizeof(_Tp);
 #else
-// NOLINTNEXTLINE(readability-redundant-preprocessor) This is https://llvm.org/PR64825
-#  if __has_cpp_attribute(__no_unique_address__)
 template <class _Tp>
 struct _FirstPaddingByte {
----------------
ldionne wrote:

Does this implementation (without the `__datasizeof` builtin) always give us the right answer?

https://github.com/llvm/llvm-project/pull/106832


More information about the libcxx-commits mailing list