[libcxx-commits] [PATCH] D131421: [libc++] Uses operator<=> in string.

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Aug 10 14:00:44 PDT 2022


philnik accepted this revision.
philnik added a comment.
This revision is now accepted and ready to land.

LGTM % nits.



================
Comment at: libcxx/include/string:378
 template<class charT, class traits, class Allocator>
-bool operator==(const charT* lhs, const basic_string<charT, traits, Allocator>& rhs) noexcept;  // constexpr since C++20
+bool operator==(const charT* lhs, const basic_string<charT, traits, Allocator>& rhs) noexcept;  // constexpr since C++20, removed in C++20
 
----------------
These shouldn't both be `constexpr` since C++20 and removed in C++20.


================
Comment at: libcxx/test/std/strings/basic.string/string.nonmembers/string.cmp/comparison.pass.cpp:9-11
+// Starting with C++20 the spaceship operator was included. This tests
+// comparison in that context, thus doesn't support older language versions.
+// These are tested per operator.
----------------
Why do you explain why the test is marked unsupported C++03 - C++17? AFAIK we do that nowhere else.


================
Comment at: libcxx/test/std/strings/basic.string/string.nonmembers/string.cmp/comparison.pass.cpp:78
+
+  return true;
+}
----------------
You don't have to return true here. Just from the main test function.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131421



More information about the libcxx-commits mailing list