[libcxx-commits] [PATCH] D127672: [libc++] Test the size of basic_string

Hubert Tong via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 16 15:30:41 PDT 2022


hubert.reinterpretcast added inline comments.


================
Comment at: libcxx/test/libcxx/strings/basic.string/alignof.compile.pass.cpp:99
+static_assert(alignof(test_string<char>) == 4, "");
+static_assert(alignof(small_string<char>) == 2, "");
+
----------------
This used to pass on AIX, but changes to use bitfields (without applying `_LIBCPP_PACKED_BYTE_FOR_AIX`) has broken this.


================
Comment at: libcxx/test/libcxx/strings/basic.string/alignof.compile.pass.cpp:111
+static_assert(alignof(test_string<wchar_t>) == 4, "");
+static_assert(alignof(small_string<wchar_t>) == 2, "");
+#    else
----------------
Same comment as above.


================
Comment at: libcxx/test/libcxx/strings/basic.string/sizeof.compile.pass.cpp:109
+static_assert(sizeof(test_string<char>) == 24, "");
+static_assert(sizeof(small_string<char>) == 6, "");
+
----------------
This used to pass on AIX, but changes to use bitfields (without applying `_LIBCPP_PACKED_BYTE_FOR_AIX`) has broken this.


================
Comment at: libcxx/test/libcxx/strings/basic.string/sizeof.compile.pass.cpp:121
+static_assert(sizeof(test_string<wchar_t>) == 24, "");
+static_assert(sizeof(small_string<wchar_t>) == 6, "");
+#    else
----------------
Same comment as above.


================
Comment at: libcxx/test/libcxx/strings/basic.string/sizeof.compile.pass.cpp:141
+static_assert(sizeof(test_string<char32_t>) == 24, "");
+static_assert(sizeof(small_string<char16_t>) == 6, "");
+static_assert(sizeof(small_string<char32_t>) == 12, "");
----------------
Same comment as above.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127672



More information about the libcxx-commits mailing list