Skip to content

Commit 6e0c6f9

Browse files
committed
[libc++][numeric][NFC] Cleanup *Saturation arithmetic* tests
This simplifies the tests a little bit: Fixed -> TODO(LLVM20): remove [[maybe_unused]] and `{}` scope since all supported compilers support "Placeholder variables with no name"
1 parent 2bae7ae commit 6e0c6f9

File tree

5 files changed

+72
-83
lines changed

5 files changed

+72
-83
lines changed

libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/add_sat.pass.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ constexpr bool test_signed() {
2525
constexpr auto minVal = std::numeric_limits<IntegerT>::min();
2626
constexpr auto maxVal = std::numeric_limits<IntegerT>::max();
2727

28-
// TODO(LLVM-20) remove [[maybe_unused]] since all supported compilers support "Placeholder variables with no name"
29-
[[maybe_unused]] std::same_as<IntegerT> decltype(auto) _ = std::add_sat(minVal, maxVal);
28+
std::same_as<IntegerT> decltype(auto) _ = std::add_sat(minVal, maxVal);
3029

3130
static_assert(noexcept(std::add_sat(minVal, maxVal)));
3231

@@ -97,8 +96,7 @@ constexpr bool test_unsigned() {
9796
constexpr auto minVal = std::numeric_limits<IntegerT>::min();
9897
constexpr auto maxVal = std::numeric_limits<IntegerT>::max();
9998

100-
// TODO(LLVM-20) remove [[maybe_unused]] since all supported compilers support "Placeholder variables with no name"
101-
[[maybe_unused]] std::same_as<IntegerT> decltype(auto) _ = std::add_sat(minVal, maxVal);
99+
std::same_as<IntegerT> decltype(auto) _ = std::add_sat(minVal, maxVal);
102100

103101
static_assert(noexcept(std::add_sat(minVal, maxVal)));
104102

libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/div_sat.pass.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ constexpr bool test_signed() {
2626
constexpr auto minVal = std::numeric_limits<IntegerT>::min();
2727
constexpr auto maxVal = std::numeric_limits<IntegerT>::max();
2828

29-
// TODO(LLVM-20) remove [[maybe_unused]] and `{}` scope since all supported compilers support "Placeholder variables with no name"
30-
[[maybe_unused]] std::same_as<IntegerT> decltype(auto) _ = std::div_sat(minVal, maxVal);
29+
std::same_as<IntegerT> decltype(auto) _ = std::div_sat(minVal, maxVal);
3130

3231
static_assert(noexcept(std::div_sat(minVal, maxVal)));
3332

@@ -89,8 +88,7 @@ constexpr bool test_unsigned() {
8988
constexpr auto minVal = std::numeric_limits<IntegerT>::min();
9089
constexpr auto maxVal = std::numeric_limits<IntegerT>::max();
9190

92-
// TODO(LLVM-20) remove [[maybe_unused]] since all supported compilers support "Placeholder variables with no name"
93-
[[maybe_unused]] std::same_as<IntegerT> decltype(auto) _ = std::div_sat(minVal, maxVal);
91+
std::same_as<IntegerT> decltype(auto) _ = std::div_sat(minVal, maxVal);
9492
static_assert(noexcept(std::div_sat(minVal, maxVal)));
9593

9694
// clang-format off

libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/mul_sat.pass.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ constexpr bool test_signed() {
2626
constexpr auto minVal = std::numeric_limits<IntegerT>::min();
2727
constexpr auto maxVal = std::numeric_limits<IntegerT>::max();
2828

29-
// TODO(LLVM-20) remove [[maybe_unused]] since all supported compilers support "Placeholder variables with no name"
30-
[[maybe_unused]] std::same_as<IntegerT> decltype(auto) _ = std::mul_sat(minVal, maxVal);
29+
std::same_as<IntegerT> decltype(auto) _ = std::mul_sat(minVal, maxVal);
3130

3231
static_assert(noexcept(std::mul_sat(minVal, maxVal)));
3332

@@ -103,8 +102,7 @@ constexpr bool test_unsigned() {
103102
constexpr auto minVal = std::numeric_limits<IntegerT>::min();
104103
constexpr auto maxVal = std::numeric_limits<IntegerT>::max();
105104

106-
// TODO(LLVM-20) remove [[maybe_unused]] since all supported compilers support "Placeholder variables with no name"
107-
[[maybe_unused]] std::same_as<IntegerT> decltype(auto) _ = std::mul_sat(minVal, maxVal);
105+
std::same_as<IntegerT> decltype(auto) _ = std::mul_sat(minVal, maxVal);
108106

109107
static_assert(noexcept(std::mul_sat(minVal, maxVal)));
110108

0 commit comments

Comments
 (0)