[libcxx-commits] [libcxxabi] [libc++] Fix the behavior of throwing `operator new` under -fno-exceptions (PR #69498)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 18 12:08:20 PDT 2023


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 e8fe4de64ffb84924c41e54116a04570046eed74 77c0256c3ae99808a8def68bfcf5eee2fad704ca -- libcxx/test/libcxx/language.support/support.dynamic/assert.nothrow_new_not_overridden_fno_exceptions.pass.cpp libcxx/test/libcxx/language.support/support.dynamic/new_dont_return_nullptr.pass.cpp libcxx/src/new.cpp libcxxabi/src/stdlib_new_delete.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/test/libcxx/language.support/support.dynamic/new_dont_return_nullptr.pass.cpp b/libcxx/test/libcxx/language.support/support.dynamic/new_dont_return_nullptr.pass.cpp
index 93a5a12349c9..548046b0ab43 100644
--- a/libcxx/test/libcxx/language.support/support.dynamic/new_dont_return_nullptr.pass.cpp
+++ b/libcxx/test/libcxx/language.support/support.dynamic/new_dont_return_nullptr.pass.cpp
@@ -29,9 +29,9 @@
 #include "check_assertion.h"
 
 int main(int, char**) {
-    EXPECT_DEATH((void)operator new(std::numeric_limits<std::size_t>::max()));
-    EXPECT_DEATH((void)operator new(std::numeric_limits<std::size_t>::max(), static_cast<std::align_val_t>(32)));
-    EXPECT_DEATH((void)operator new[](std::numeric_limits<std::size_t>::max()));
-    EXPECT_DEATH((void)operator new[](std::numeric_limits<std::size_t>::max(), static_cast<std::align_val_t>(32)));
-    return 0;
+  EXPECT_DEATH((void)operator new(std::numeric_limits<std::size_t>::max()));
+  EXPECT_DEATH((void)operator new(std::numeric_limits<std::size_t>::max(), static_cast<std::align_val_t>(32)));
+  EXPECT_DEATH((void)operator new[](std::numeric_limits<std::size_t>::max()));
+  EXPECT_DEATH((void)operator new[](std::numeric_limits<std::size_t>::max(), static_cast<std::align_val_t>(32)));
+  return 0;
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/69498


More information about the libcxx-commits mailing list