[libcxx-commits] [libcxx] a947399 - [libcxx][test] test _LIBCPP_VERSION with #ifdef, not #if
Casey Carter via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jan 18 19:37:11 PST 2022
Author: Casey Carter
Date: 2022-01-18T19:37:03-08:00
New Revision: a94739985b2c785f036a807c43b561f4befedd69
URL: https://github.com/llvm/llvm-project/commit/a94739985b2c785f036a807c43b561f4befedd69
DIFF: https://github.com/llvm/llvm-project/commit/a94739985b2c785f036a807c43b561f4befedd69.diff
LOG: [libcxx][test] test _LIBCPP_VERSION with #ifdef, not #if
Added:
Modified:
libcxx/test/std/utilities/format/format.arguments/format.arg/operator_bool.pass.cpp
libcxx/test/std/utilities/format/format.functions/format_tests.h
Removed:
################################################################################
diff --git a/libcxx/test/std/utilities/format/format.arguments/format.arg/operator_bool.pass.cpp b/libcxx/test/std/utilities/format/format.arguments/format.arg/operator_bool.pass.cpp
index 1bf7fdc3503d7..50f6885ba8c67 100644
--- a/libcxx/test/std/utilities/format/format.arguments/format.arg/operator_bool.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.arguments/format.arg/operator_bool.pass.cpp
@@ -24,7 +24,7 @@
#include "test_macros.h"
void test(const auto& store) {
-#if _LIBCPP_VERSION
+#ifdef _LIBCPP_VERSION
for (const auto& arg : store.__args) {
assert(arg);
assert(static_cast<bool>(arg));
diff --git a/libcxx/test/std/utilities/format/format.functions/format_tests.h b/libcxx/test/std/utilities/format/format.functions/format_tests.h
index 54d304327b6ca..470da03b8b083 100644
--- a/libcxx/test/std/utilities/format/format.functions/format_tests.h
+++ b/libcxx/test/std/utilities/format/format.functions/format_tests.h
@@ -145,7 +145,7 @@ void format_test_string(T world, T universe, TestFunction check,
STR("hello {:0}"), world);
// *** width ***
-#if _LIBCPP_VERSION
+#ifdef _LIBCPP_VERSION
// This limit isn't specified in the Standard.
static_assert(std::__format::__number_max == 2'147'483'647,
"Update the assert and the test.");
@@ -180,7 +180,7 @@ void format_test_string(T world, T universe, TestFunction check,
check_exception("Invalid arg-id", STR("hello {0:{01}}"), world, 1);
// *** precision ***
-#if _LIBCPP_VERSION
+#ifdef _LIBCPP_VERSION
// This limit isn't specified in the Standard.
static_assert(std::__format::__number_max == 2'147'483'647,
"Update the assert and the test.");
More information about the libcxx-commits
mailing list