[libcxx-commits] [PATCH] D149360: [libc++] Fix __verbose_abort in C++11
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Apr 27 10:55:11 PDT 2023
ldionne created this revision.
Herald added a project: All.
ldionne requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.
__use() can't be marked as constexpr in C++11 because it returns void,
which is not a literal type. But it turns out that we just don't need
to define it at all, since it's never called outside of decltype.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D149360
Files:
libcxx/include/__verbose_abort
Index: libcxx/include/__verbose_abort
===================================================================
--- libcxx/include/__verbose_abort
+++ libcxx/include/__verbose_abort
@@ -47,7 +47,7 @@
# if defined(_LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT)
// The decltype is there to suppress -Wunused warnings in this configuration.
-_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR void __use(const char*, ...) { }
+void __use(const char*, ...);
# define _LIBCPP_VERBOSE_ABORT(...) (decltype(::std::__use(__VA_ARGS__))(), __builtin_abort())
# else
# define _LIBCPP_VERBOSE_ABORT(...) ::std::__libcpp_verbose_abort(__VA_ARGS__)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149360.517646.patch
Type: text/x-patch
Size: 636 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230427/de0142c3/attachment.bin>
More information about the libcxx-commits
mailing list