[libcxx-commits] [libcxx] 2dd0c4d - [libcxx][test] Update directory_entry test for C++20
Casey Carter via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jan 28 09:45:25 PST 2021
Author: Casey Carter
Date: 2021-01-28T09:40:54-08:00
New Revision: 2dd0c4d8462658c9a721356b306aa52825612416
URL: https://github.com/llvm/llvm-project/commit/2dd0c4d8462658c9a721356b306aa52825612416
DIFF: https://github.com/llvm/llvm-project/commit/2dd0c4d8462658c9a721356b306aa52825612416.diff
LOG: [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.
Added:
Modified:
libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/comparisons.pass.cpp
Removed:
################################################################################
diff --git a/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/comparisons.pass.cpp b/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/comparisons.pass.cpp
index 74fbd6c865bc..e71d4e24664a 100644
--- a/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/comparisons.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/comparisons.pass.cpp
@@ -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(==);
More information about the libcxx-commits
mailing list