flang: Fix build with latest libc++ (#127362)

I think this first stopped working with
954836634abb446f18719b14120c386a929a42d1. This patch fixes the following
error:

/home/runner/work/llvm-project/llvm-project/flang/runtime/io-api-minimal.cpp:153:11:
error: '__libcpp_verbose_abort' is missing exception specification
'noexcept'
   153 | void std::__libcpp_verbose_abort(char const *format, ...) {
       |           ^
| noexcept
/mnt/build/bin/../include/c++/v1/__verbose_abort:30:28: note: previous
declaration is here
30 | __printf__, 1, 2) void __libcpp_verbose_abort(const char* __format,
...) _LIBCPP_VERBOSE_ABORT_NOEXCEPT;
       |                            ^
1 error generated.

(cherry picked from commit 2b340c10a611d929fee25e6222909c8915e3d6b6)
This commit is contained in:
Tom Stellard 2025-02-19 06:53:30 -08:00 committed by llvmbot
parent 876a5c9e59
commit 2b70b17d30

View File

@ -150,7 +150,8 @@ bool IODEF(OutputLogical)(Cookie cookie, bool truth) {
// Provide own definition for `std::__libcpp_verbose_abort` to avoid dependency
// on the version provided by libc++.
void std::__libcpp_verbose_abort(char const *format, ...) {
void std::__libcpp_verbose_abort(char const *format, ...) noexcept(
noexcept(std::__libcpp_verbose_abort(""))) {
va_list list;
va_start(list, format);
std::vfprintf(stderr, format, list);