Skip to content

[libc++] Avoid including <__config> directly in the test suite #106080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Aug 26, 2024

Fixes #105878

@ldionne ldionne requested a review from a team as a code owner August 26, 2024 14:22
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Aug 26, 2024
@llvmbot
Copy link
Member

llvmbot commented Aug 26, 2024

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

Fixes #105878


Full diff: https://github.com/llvm/llvm-project/pull/106080.diff

1 Files Affected:

  • (modified) libcxx/test/support/fp_compare.h (+4-3)
diff --git a/libcxx/test/support/fp_compare.h b/libcxx/test/support/fp_compare.h
index 3088a211dadc3b..63f174e0a29d87 100644
--- a/libcxx/test/support/fp_compare.h
+++ b/libcxx/test/support/fp_compare.h
@@ -9,16 +9,17 @@
 #ifndef SUPPORT_FP_COMPARE_H
 #define SUPPORT_FP_COMPARE_H
 
-#include <cmath>     // for std::abs
 #include <algorithm> // for std::max
 #include <cassert>
-#include <__config>
+#include <cmath>     // for std::abs
+
+#include "test_macros.h"
 
 // See https://www.boost.org/doc/libs/1_70_0/libs/test/doc/html/boost_test/testing_tools/extended_comparison/floating_point/floating_points_comparison_theory.html
 
 template <typename T>
 bool fptest_close(T val, T expected, T eps) {
-  _LIBCPP_CONSTEXPR T zero = T(0);
+  TEST_CONSTEXPR T zero = T(0);
   assert(eps >= zero);
 
   // Handle the zero cases

Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 1c48c9cc43dbbbd1751e15d199b4d7d4fc52d828 e63394b940b374ee719d7c04e3fb1500a097efe2 --extensions h -- libcxx/test/support/fp_compare.h
View the diff from clang-format here.
diff --git a/libcxx/test/support/fp_compare.h b/libcxx/test/support/fp_compare.h
index 63f174e0a2..237ee50d1f 100644
--- a/libcxx/test/support/fp_compare.h
+++ b/libcxx/test/support/fp_compare.h
@@ -11,7 +11,7 @@
 
 #include <algorithm> // for std::max
 #include <cassert>
-#include <cmath>     // for std::abs
+#include <cmath> // for std::abs
 
 #include "test_macros.h"
 

@ldionne ldionne merged commit 06edc1c into llvm:main Aug 26, 2024
8 of 10 checks passed
@ldionne ldionne deleted the review/fp_compare_config_fix branch August 26, 2024 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[libc++][test] fp_compare.h includes non-portable <__config>
2 participants