Skip to content

Commit 88e8ad4

Browse files
committed
flang: Fix build with latest libc++
I think this first stopped working with 9548366. 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.
1 parent c568022 commit 88e8ad4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

flang/runtime/io-api-minimal.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,12 @@ bool IODEF(OutputLogical)(Cookie cookie, bool truth) {
150150
// Provide own definition for `std::__libcpp_verbose_abort` to avoid dependency
151151
// on the version provided by libc++.
152152

153-
void std::__libcpp_verbose_abort(char const *format, ...) {
153+
#if !defined(_LIBCPP_VERBOSE_ABORT_NOT_NOEXCEPT)
154+
#define _LIBCPP_VERBOSE_ABORT_NOT_NOEXCEPT
155+
#endif
156+
157+
158+
void std::__libcpp_verbose_abort(char const *format, ...) _LIBCPP_VERBOSE_ABORT_NOT_NOEXCEP {
154159
va_list list;
155160
va_start(list, format);
156161
std::vfprintf(stderr, format, list);

0 commit comments

Comments
 (0)