[libcxx-commits] [libcxx] [libcxxabi] [libc++] Fix noexcept behaviour of operator new helper functions (PR #74337)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 12 13:52:28 PST 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 67f387c67e2a1bfa9432cff372462e204e0952bc 227d0ba122403e8773318eca47a05e7fc2a5421e -- libcxxabi/test/test_memory_alloc.pass.cpp libcxxabi/test/test_memory_alloc1.pass.cpp libcxxabi/test/test_memory_alloc2.pass.cpp libcxxabi/test/test_memory_alloc3.pass.cpp libcxxabi/test/test_memory_alloc4.pass.cpp libcxxabi/test/test_memory_alloc_nothrow1.pass.cpp libcxxabi/test/test_memory_alloc_nothrow2.pass.cpp libcxxabi/test/test_memory_alloc_nothrow3.pass.cpp libcxxabi/test/test_memory_alloc_nothrow4.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/libcxxabi/test/test_memory_alloc1.pass.cpp b/libcxxabi/test/test_memory_alloc1.pass.cpp
index aa202e04e8..3b3a2aa418 100644
--- a/libcxxabi/test/test_memory_alloc1.pass.cpp
+++ b/libcxxabi/test/test_memory_alloc1.pass.cpp
@@ -14,9 +14,9 @@
 
 struct construction_key {};
 struct my_bad_alloc : std::bad_alloc {
-  my_bad_alloc(const my_bad_alloc &) : self(this) { std::abort(); }
+  my_bad_alloc(const my_bad_alloc&) : self(this) { std::abort(); }
   my_bad_alloc(construction_key) : self(this) {}
-  const my_bad_alloc *const self;
+  const my_bad_alloc* const self;
 };
 
 int new_handler_called = 0;
diff --git a/libcxxabi/test/test_memory_alloc2.pass.cpp b/libcxxabi/test/test_memory_alloc2.pass.cpp
index 1049d7d3a6..88da9658c8 100644
--- a/libcxxabi/test/test_memory_alloc2.pass.cpp
+++ b/libcxxabi/test/test_memory_alloc2.pass.cpp
@@ -14,9 +14,9 @@
 
 struct construction_key {};
 struct my_bad_alloc : std::bad_alloc {
-  my_bad_alloc(const my_bad_alloc &) : self(this) { std::abort(); }
+  my_bad_alloc(const my_bad_alloc&) : self(this) { std::abort(); }
   my_bad_alloc(construction_key) : self(this) {}
-  const my_bad_alloc *const self;
+  const my_bad_alloc* const self;
 };
 
 int new_handler_called = 0;
diff --git a/libcxxabi/test/test_memory_alloc3.pass.cpp b/libcxxabi/test/test_memory_alloc3.pass.cpp
index fee1f15bd6..ba454471e0 100644
--- a/libcxxabi/test/test_memory_alloc3.pass.cpp
+++ b/libcxxabi/test/test_memory_alloc3.pass.cpp
@@ -14,9 +14,9 @@
 
 struct construction_key {};
 struct my_bad_alloc : std::bad_alloc {
-  my_bad_alloc(const my_bad_alloc &) : self(this) { std::abort(); }
+  my_bad_alloc(const my_bad_alloc&) : self(this) { std::abort(); }
   my_bad_alloc(construction_key) : self(this) {}
-  const my_bad_alloc *const self;
+  const my_bad_alloc* const self;
 };
 
 int new_handler_called = 0;
diff --git a/libcxxabi/test/test_memory_alloc4.pass.cpp b/libcxxabi/test/test_memory_alloc4.pass.cpp
index 1a152ef6ed..ad64596db0 100644
--- a/libcxxabi/test/test_memory_alloc4.pass.cpp
+++ b/libcxxabi/test/test_memory_alloc4.pass.cpp
@@ -14,9 +14,9 @@
 
 struct construction_key {};
 struct my_bad_alloc : std::bad_alloc {
-  my_bad_alloc(const my_bad_alloc &) : self(this) { std::abort(); }
+  my_bad_alloc(const my_bad_alloc&) : self(this) { std::abort(); }
   my_bad_alloc(construction_key) : self(this) {}
-  const my_bad_alloc *const self;
+  const my_bad_alloc* const self;
 };
 
 int new_handler_called = 0;
diff --git a/libcxxabi/test/test_memory_alloc_nothrow1.pass.cpp b/libcxxabi/test/test_memory_alloc_nothrow1.pass.cpp
index 49ceefe56a..51992f0b8d 100644
--- a/libcxxabi/test/test_memory_alloc_nothrow1.pass.cpp
+++ b/libcxxabi/test/test_memory_alloc_nothrow1.pass.cpp
@@ -14,9 +14,9 @@
 
 struct construction_key {};
 struct my_bad_alloc : std::bad_alloc {
-  my_bad_alloc(const my_bad_alloc &) : self(this) { std::abort(); }
+  my_bad_alloc(const my_bad_alloc&) : self(this) { std::abort(); }
   my_bad_alloc(construction_key) : self(this) {}
-  const my_bad_alloc *const self;
+  const my_bad_alloc* const self;
 };
 
 int new_handler_called = 0;
diff --git a/libcxxabi/test/test_memory_alloc_nothrow2.pass.cpp b/libcxxabi/test/test_memory_alloc_nothrow2.pass.cpp
index deff9f0a1b..6dda87d090 100644
--- a/libcxxabi/test/test_memory_alloc_nothrow2.pass.cpp
+++ b/libcxxabi/test/test_memory_alloc_nothrow2.pass.cpp
@@ -14,9 +14,9 @@
 
 struct construction_key {};
 struct my_bad_alloc : std::bad_alloc {
-  my_bad_alloc(const my_bad_alloc &) : self(this) { std::abort(); }
+  my_bad_alloc(const my_bad_alloc&) : self(this) { std::abort(); }
   my_bad_alloc(construction_key) : self(this) {}
-  const my_bad_alloc *const self;
+  const my_bad_alloc* const self;
 };
 
 int new_handler_called = 0;
diff --git a/libcxxabi/test/test_memory_alloc_nothrow3.pass.cpp b/libcxxabi/test/test_memory_alloc_nothrow3.pass.cpp
index 62072254dd..ce52a1e3c2 100644
--- a/libcxxabi/test/test_memory_alloc_nothrow3.pass.cpp
+++ b/libcxxabi/test/test_memory_alloc_nothrow3.pass.cpp
@@ -14,9 +14,9 @@
 
 struct construction_key {};
 struct my_bad_alloc : std::bad_alloc {
-  my_bad_alloc(const my_bad_alloc &) : self(this) { std::abort(); }
+  my_bad_alloc(const my_bad_alloc&) : self(this) { std::abort(); }
   my_bad_alloc(construction_key) : self(this) {}
-  const my_bad_alloc *const self;
+  const my_bad_alloc* const self;
 };
 
 int new_handler_called = 0;
diff --git a/libcxxabi/test/test_memory_alloc_nothrow4.pass.cpp b/libcxxabi/test/test_memory_alloc_nothrow4.pass.cpp
index b6d183e846..8f4f66f1d1 100644
--- a/libcxxabi/test/test_memory_alloc_nothrow4.pass.cpp
+++ b/libcxxabi/test/test_memory_alloc_nothrow4.pass.cpp
@@ -14,9 +14,9 @@
 
 struct construction_key {};
 struct my_bad_alloc : std::bad_alloc {
-  my_bad_alloc(const my_bad_alloc &) : self(this) { std::abort(); }
+  my_bad_alloc(const my_bad_alloc&) : self(this) { std::abort(); }
   my_bad_alloc(construction_key) : self(this) {}
-  const my_bad_alloc *const self;
+  const my_bad_alloc* const self;
 };
 
 int new_handler_called = 0;

``````````

</details>


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


More information about the libcxx-commits mailing list