[libcxx-commits] [libcxx] [libc++][RFC] Always define internal feature test macros (PR #89178)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Apr 18 00:32:49 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 3d56ea05b6c746a7144f643bef2ebd599f605b8b eebe2de703cef0453adf7cb578463a3587ef323e -- libcxx/include/__atomic/aliases.h libcxx/include/__atomic/atomic_lock_free.h libcxx/include/__availability libcxx/include/__bit/byteswap.h libcxx/include/__bit/countl.h libcxx/include/__charconv/tables.h libcxx/include/__charconv/to_chars_base_10.h libcxx/include/__charconv/to_chars_integral.h libcxx/include/__charconv/traits.h libcxx/include/__chrono/file_clock.h libcxx/include/__config libcxx/include/__debug_utils/sanitizers.h libcxx/include/__exception/exception_ptr.h libcxx/include/__exception/nested_exception.h libcxx/include/__expected/expected.h libcxx/include/__filesystem/filesystem_error.h libcxx/include/__filesystem/path.h libcxx/include/__filesystem/u8path.h libcxx/include/__format/format_arg.h libcxx/include/__format/format_arg_store.h libcxx/include/__format/format_error.h libcxx/include/__format/format_functions.h libcxx/include/__format/formatter_integer.h libcxx/include/__functional/function.h libcxx/include/__functional/hash.h libcxx/include/__fwd/string.h libcxx/include/__fwd/string_view.h libcxx/include/__hash_table libcxx/include/__iterator/counted_iterator.h libcxx/include/__locale libcxx/include/__memory/aligned_alloc.h libcxx/include/__memory/shared_ptr.h libcxx/include/__memory/temporary_buffer.h libcxx/include/__memory/uninitialized_algorithms.h libcxx/include/__pstl/backends/libdispatch.h libcxx/include/__random/is_valid.h libcxx/include/__random/log2.h libcxx/include/__split_buffer libcxx/include/__std_clang_module libcxx/include/__string/char_traits.h libcxx/include/__system_error/system_error.h libcxx/include/__type_traits/is_integral.h libcxx/include/__type_traits/is_signed_integer.h libcxx/include/__type_traits/is_swappable.h libcxx/include/__type_traits/is_unsigned_integer.h libcxx/include/__type_traits/make_32_64_or_128_bit.h libcxx/include/__type_traits/make_signed.h libcxx/include/__type_traits/make_unsigned.h libcxx/include/__type_traits/promote.h libcxx/include/__utility/convert_to_integral.h libcxx/include/__utility/exception_guard.h libcxx/include/any libcxx/include/atomic libcxx/include/cuchar libcxx/include/deque libcxx/include/experimental/__simd/utility.h libcxx/include/forward_list libcxx/include/fstream libcxx/include/future libcxx/include/iomanip libcxx/include/ios libcxx/include/iosfwd libcxx/include/istream libcxx/include/list libcxx/include/new libcxx/include/optional libcxx/include/ostream libcxx/include/regex libcxx/include/sstream libcxx/include/stdexcept libcxx/include/string libcxx/include/string_view libcxx/include/syncstream libcxx/include/typeinfo libcxx/include/valarray libcxx/include/variant libcxx/include/vector libcxx/include/version libcxx/modules/std.compat/cuchar.inc libcxx/modules/std/atomic.inc libcxx/modules/std/cuchar.inc libcxx/modules/std/iosfwd.inc libcxx/modules/std/memory.inc libcxx/modules/std/string.inc libcxx/modules/std/string_view.inc libcxx/src/filesystem/error.h libcxx/src/filesystem/format_string.h libcxx/src/filesystem/int128_builtins.cpp libcxx/src/future.cpp libcxx/src/ios.cpp libcxx/src/locale.cpp libcxx/src/memory_resource.cpp libcxx/src/new.cpp libcxx/src/new_helpers.cpp libcxx/src/ostream.cpp libcxx/src/stdexcept.cpp libcxx/src/system_error.cpp libcxx/test/libcxx/concepts/concepts.arithmetic/__libcpp_integer.compile.pass.cpp libcxx/test/libcxx/concepts/concepts.arithmetic/__libcpp_signed_integer.compile.pass.cpp libcxx/test/libcxx/concepts/concepts.arithmetic/__libcpp_unsigned_integer.compile.pass.cpp libcxx/test/libcxx/memory/aligned_allocation_macro.compile.pass.cpp libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp libcxx/test/std/atomics/stdatomic.h.syn/types.compile.pass.cpp libcxx/test/std/strings/c.strings/no_c8rtomb_mbrtoc8.verify.cpp libcxx/test/support/test.support/make_string_header.pass.cpp libcxx/test/support/test_macros.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/include/__type_traits/is_swappable.h b/libcxx/include/__type_traits/is_swappable.h
index b0526c2fa7..35851836ce 100644
--- a/libcxx/include/__type_traits/is_swappable.h
+++ b/libcxx/include/__type_traits/is_swappable.h
@@ -75,8 +75,8 @@ template <class _Tp, class _Up = _Tp, bool _Swappable = __swappable_with<_Tp, _U
struct __nothrow_swappable_with {
static const bool value =
#if _LIBCPP_HAS_NOEXCEPT
- noexcept(swap(std::declval<_Tp>(), std::declval<_Up>()))&& noexcept(
- swap(std::declval<_Up>(), std::declval<_Tp>()));
+ noexcept(swap(std::declval<_Tp>(), std::declval<_Up>())) &&
+ noexcept(swap(std::declval<_Up>(), std::declval<_Tp>()));
#else
false;
#endif
diff --git a/libcxx/test/libcxx/memory/aligned_allocation_macro.compile.pass.cpp b/libcxx/test/libcxx/memory/aligned_allocation_macro.compile.pass.cpp
index d1dcff3982..6249c52814 100644
--- a/libcxx/test/libcxx/memory/aligned_allocation_macro.compile.pass.cpp
+++ b/libcxx/test/libcxx/memory/aligned_allocation_macro.compile.pass.cpp
@@ -12,7 +12,6 @@
#include "test_macros.h"
-
#if !_LIBCPP_HAS_ALIGNED_ALLOCATION
-# error "libc++ should have aligned allocation in C++17 and up when targeting a platform that supports it"
+# error "libc++ should have aligned allocation in C++17 and up when targeting a platform that supports it"
#endif
diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index d8b0941ac8..04bcb4c3b3 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -389,7 +389,7 @@ inline Tp const& DoNotOptimize(Tp const& value) {
#endif
#if (defined(_LIBCPP_HAS_INT128) && !_LIBCPP_HAS_INT128) || defined(_MSVC_STL_VERSION)
-# define TEST_HAS_NO_INT128
+# define TEST_HAS_NO_INT128
#endif
#if defined(_LIBCPP_HAS_NO_LOCALIZATION)
``````````
</details>
https://github.com/llvm/llvm-project/pull/89178
More information about the libcxx-commits
mailing list