Skip to content

[libc++] Removes the _LIBCPP_VERBOSE_ABORT_NOT_NOEXCEPT macro. #135494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

mordante
Copy link
Member

This makes __libcpp_verbose_abort unconditionally noexcept. This was planned for the upcomming release.

@mordante mordante requested a review from a team as a code owner April 12, 2025 13:33
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Apr 12, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 12, 2025

@llvm/pr-subscribers-libcxx

Author: Mark de Wever (mordante)

Changes

This makes __libcpp_verbose_abort unconditionally noexcept. This was planned for the upcomming release.


Full diff: https://github.com/llvm/llvm-project/pull/135494.diff

2 Files Affected:

  • (modified) libcxx/docs/ReleaseNotes/21.rst (+3-3)
  • (modified) libcxx/include/__verbose_abort (+1-7)
diff --git a/libcxx/docs/ReleaseNotes/21.rst b/libcxx/docs/ReleaseNotes/21.rst
index a8f20ed0abaf0..de92eeeaaa7dd 100644
--- a/libcxx/docs/ReleaseNotes/21.rst
+++ b/libcxx/docs/ReleaseNotes/21.rst
@@ -70,6 +70,9 @@ Deprecations and Removals
 
 - ``std::is_trivial`` and ``std::is_trivial_v`` are deprecated in C++26 and later.
 
+- The ``_LIBCPP_VERBOSE_ABORT_NOT_NOEXCEPT`` has been removed, making ``std::__libcpp_verbose_abort``
+  unconditionally ``noexcept``.
+
 Potentially breaking changes
 ----------------------------
 
@@ -91,9 +94,6 @@ LLVM 21
   If you are using C++03 in your project, you should consider moving to a newer version of the Standard to get the most
   out of libc++.
 
-- The ``_LIBCPP_VERBOSE_ABORT_NOT_NOEXCEPT`` macro will be removed in LLVM 21, making ``std::__libcpp_verbose_abort``
-  unconditionally ``noexcept``.
-
 - Non-conforming extension ``packaged_task::result_type`` will be removed in LLVM 21.
 
 LLVM 22
diff --git a/libcxx/include/__verbose_abort b/libcxx/include/__verbose_abort
index 2d45cd0eb7f5d..f8b696733e2b3 100644
--- a/libcxx/include/__verbose_abort
+++ b/libcxx/include/__verbose_abort
@@ -18,16 +18,10 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if defined(_LIBCPP_VERBOSE_ABORT_NOT_NOEXCEPT)
-#  define _LIBCPP_VERBOSE_ABORT_NOEXCEPT
-#else
-#  define _LIBCPP_VERBOSE_ABORT_NOEXCEPT _NOEXCEPT
-#endif
-
 // This function should never be called directly from the code -- it should only be called through
 // the _LIBCPP_VERBOSE_ABORT macro.
 [[__noreturn__]] _LIBCPP_AVAILABILITY_VERBOSE_ABORT _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_ATTRIBUTE_FORMAT(
-    __printf__, 1, 2) void __libcpp_verbose_abort(const char* __format, ...) _LIBCPP_VERBOSE_ABORT_NOEXCEPT;
+    __printf__, 1, 2) void __libcpp_verbose_abort(const char* __format, ...) _NOEXCEPT;
 
 // _LIBCPP_VERBOSE_ABORT(format, args...)
 //

Copy link

github-actions bot commented Apr 12, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff HEAD~1 HEAD --extensions ,cpp -- libcxx/include/__verbose_abort libcxx/src/verbose_abort.cpp
View the diff from clang-format here.
diff --git a/libcxx/include/__verbose_abort b/libcxx/include/__verbose_abort
index f8b696733..73295cae4 100644
--- a/libcxx/include/__verbose_abort
+++ b/libcxx/include/__verbose_abort
@@ -20,8 +20,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 // This function should never be called directly from the code -- it should only be called through
 // the _LIBCPP_VERBOSE_ABORT macro.
-[[__noreturn__]] _LIBCPP_AVAILABILITY_VERBOSE_ABORT _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_ATTRIBUTE_FORMAT(
-    __printf__, 1, 2) void __libcpp_verbose_abort(const char* __format, ...) _NOEXCEPT;
+[[__noreturn__]] _LIBCPP_AVAILABILITY_VERBOSE_ABORT _LIBCPP_OVERRIDABLE_FUNC_VIS
+_LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 2) void __libcpp_verbose_abort(const char* __format, ...) _NOEXCEPT;
 
 // _LIBCPP_VERBOSE_ABORT(format, args...)
 //

This makes __libcpp_verbose_abort unconditionally noexcept. This was
planned for the upcomming release.
@mordante mordante force-pushed the review/remove__LIBCPP_VERBOSE_ABORT_NOT_NOEXCEPT branch from 42e707b to 131fc4b Compare April 12, 2025 13:45
@mordante mordante merged commit 1175f5b into llvm:main Apr 14, 2025
75 of 81 checks passed
@mordante mordante deleted the review/remove__LIBCPP_VERBOSE_ABORT_NOT_NOEXCEPT branch April 14, 2025 16:57
bcardosolopes added a commit to bcardosolopes/llvm-project that referenced this pull request Apr 14, 2025
* origin/main: (199 commits)
  [NFC][AsmPrinter] Refactor AsmPrinter and AArch64AsmPrinter to prepare for jump table partitions on aarch64 (llvm#125993)
  [HEXAGON] Fix corner cases for hwloops pass (llvm#135439)
  [flang] Handle volatility in lowering and codegen (llvm#135311)
  [MLIR][Shape] Support >2 args in `shape.broadcast` folder (llvm#126808)
  [DirectX] Use scalar arguments for @llvm.dx.dot intrinsics (llvm#134570)
  Remove the redundant check for "WeakPtr" in isSmartPtrClass to fix the issue 135612. (llvm#135629)
  [BOLT] Support relative vtable (llvm#135449)
  [flang] Fix linking to libMLIR (llvm#135483)
  [AsmPrinter] Link .section_sizes to the correct section (llvm#135583)
  [ctxprof] Handle instrumenting functions with `musttail` calls (llvm#135121)
  [SystemZ] Consider VST/VL as SimpleBDXStore/Load (llvm#135623)
  [libc++][CI] Pin the XCode version. (llvm#135412)
  [lldb-dap] Fix win32 build. (llvm#135638)
  [Interp] Mark inline-virtual.cpp as unsupported with ASan (llvm#135402)
  [libc++] Removes the _LIBCPP_VERBOSE_ABORT_NOT_NOEXCEPT macro. (llvm#135494)
  [CVP] Add tests for ucmp/scmp with switch (NFC)
  [mlir][tosa] Align AbsOp example variable names (llvm#135268)
  [mlir][tosa] Align AddOp examples to spec (llvm#135266)
  [mlir][tosa] Align RFFT2d and FFT2d operator examples (llvm#135261)
  [flang][OpenMP][HLFIR] Support vector subscripted array sections for DEPEND (llvm#133892)
  ...
var-const pushed a commit to ldionne/llvm-project that referenced this pull request Apr 17, 2025
…135494)

This makes __libcpp_verbose_abort unconditionally noexcept. This was
planned for the upcomming release.
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.

3 participants