Commit 2dd0c4d8 authored by Casey Carter's avatar Casey Carter
Browse files

[libcxx][test] Update directory_entry test for C++20

P1614R2 removes most of `directory_entry`'s member comparison operators, leaving only `operator==` and `operator<=>`. This test should require the comparison expressions to be valid rather than require the member functions to be present so it is correct in both C++17 and C++20 modes.
parent 0bca9a7c
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -28,13 +28,14 @@


#define CHECK_OP(Op) \
  static_assert(std::is_same<decltype(ce. operator Op (ce)), bool>::value, ""); \
  static_assert(noexcept(ce.operator Op (ce)), "Operation must be noexcept" )
  static_assert(std::is_same<decltype(ce Op ce), bool>::value, ""); \
  static_assert(noexcept(ce Op ce), "Operation must be noexcept" )

void test_comparison_signatures() {
  using namespace fs;
  path const p("foo/bar/baz");
  // Check that the operators are member functions with the correct signatures.
  // Check that the operators are valid, yield bool, and are not
  // potentially-throwing.
  {
    directory_entry const ce(p);
    CHECK_OP(==);