[libcxx-commits] [libcxxabi] [libc++abi] Remove unnecessary dependency on std::unique_ptr (PR #73277)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Nov 23 19:13:19 PST 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 28d91a6e17c58c129eda75c53448c8a81d63b445 cae0d19c5d1a38b98d999fb58ed2c5c0e563c295 -- libcxxabi/src/cxa_default_handlers.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxxabi/src/cxa_default_handlers.cpp b/libcxxabi/src/cxa_default_handlers.cpp
index e88d6c87a5..911e5b9925 100644
--- a/libcxxabi/src/cxa_default_handlers.cpp
+++ b/libcxxabi/src/cxa_default_handlers.cpp
@@ -21,7 +21,7 @@
static constinit const char* cause = "uncaught";
-#ifndef _LIBCXXABI_NO_EXCEPTIONS
+# ifndef _LIBCXXABI_NO_EXCEPTIONS
__attribute__((noreturn))
static void demangling_terminate_handler()
{
@@ -43,24 +43,21 @@ static void demangling_terminate_handler()
if (!__isOurExceptionClass(unwind_exception))
abort_message("terminating due to %s foreign exception", cause);
- auto name = [str = thrown_type->name()]
- {
- #ifndef LIBCXXABI_NON_DEMANGLING_TERMINATE
- if (const char* result = __cxxabiv1::__cxa_demangle(str, nullptr,
- nullptr, nullptr))
- // We're about to abort, this memory can never be freed; so it's
- // alright to just return a raw pointer
- return result;
- #endif
- return str;
+ auto name = [str = thrown_type->name()] {
+# ifndef LIBCXXABI_NON_DEMANGLING_TERMINATE
+ if (const char* result = __cxxabiv1::__cxa_demangle(str, nullptr, nullptr, nullptr))
+ // We're about to abort, this memory can never be freed; so it's
+ // alright to just return a raw pointer
+ return result;
+# endif
+ return str;
}();
void* thrown_object =
__getExceptionClass(unwind_exception) == kOurDependentExceptionClass ?
((__cxa_dependent_exception*)exception_header)->primaryException :
exception_header + 1;
- const __shim_type_info* thrown_type =
- static_cast<const __shim_type_info*>(exception_header->exceptionType);
+ const __shim_type_info* thrown_type = static_cast<const __shim_type_info*>(exception_header->exceptionType);
// If the uncaught exception can be caught with std::exception&
const __shim_type_info* catch_type =
static_cast<const __shim_type_info*>(&typeid(std::exception));
``````````
</details>
https://github.com/llvm/llvm-project/pull/73277
More information about the libcxx-commits
mailing list