Skip to content

Commit

Permalink
Don't test equal_to<void> with different enumerations
Browse files Browse the repository at this point in the history
Clang 18 SFINAES away the return type in C++23. I've made this compiler-agnostic with the expectation that other compilers will follow suit.
  • Loading branch information
CaseyCarter committed Mar 5, 2024
1 parent 51204d6 commit 8d15355
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/std/tests/GH_000431_equal_family/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,11 @@ void test_algorithms(EqualFn equal_fn) {
assert(equal_fn(begin(arr2), end(arr2), begin(arr3), end(arr3), equal_to<short>{}));
assert(equal_fn(begin(arr2), end(arr2), begin(arr3), end(arr3), equal_to<int>{}));

#if !_HAS_CXX23
// The return type of equal_to<void>::operator(T, U) SFINAES
// when T and U are different enumeration types.
assert(equal_fn(begin(arr3), end(arr3), begin(arr4), end(arr4), equal_to<>{}));
#endif // !_HAS_CXX23
assert(equal_fn(begin(arr3), end(arr3), begin(arr4), end(arr4), equal_to<short>{}));
assert(equal_fn(begin(arr3), end(arr3), begin(arr4), end(arr4), equal_to<int>{}));
}
Expand Down

0 comments on commit 8d15355

Please sign in to comment.