KEMBAR78
[libc++] Avoid including <__config> directly in the test suite by ldionne · Pull Request #106080 · llvm/llvm-project · GitHub
Skip to content

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

@github-actions
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
@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