forked from OSchip/llvm-project
[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.
This commit is contained in:
parent
0bca9a7ce2
commit
2dd0c4d846
|
@ -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(==);
|
||||
|
|
Loading…
Reference in New Issue