Fix test failures introduced by PR #113697 (#116941)
[llvm-project.git] / libc / src / setjmp / longjmp.h
blob9b7db29717216bb9491bb4d1ed3ff5309de7ef35
1 //===-- Implementation header for longjmp -----------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIBC_SRC_SETJMP_LONGJMP_H
10 #define LLVM_LIBC_SRC_SETJMP_LONGJMP_H
12 #include "hdr/types/jmp_buf.h"
13 #include "src/__support/macros/config.h"
14 #include "src/__support/macros/properties/compiler.h"
16 namespace LIBC_NAMESPACE_DECL {
18 // TODO(https://github.com/llvm/llvm-project/issues/112427)
19 // Some of the architecture-specific definitions are marked `naked`, which in
20 // GCC implies `nothrow`.
22 // Right now, our aliases aren't marked `nothrow`, so we wind up in a situation
23 // where clang will emit -Wmissing-exception-spec if we add `nothrow` here, but
24 // GCC will emit -Wmissing-attributes here without `nothrow`. We need to update
25 // LLVM_LIBC_FUNCTION to denote when a function throws or not.
27 #ifdef LIBC_COMPILER_IS_GCC
28 [[gnu::nothrow]]
29 #endif
30 void longjmp(jmp_buf buf, int val);
32 } // namespace LIBC_NAMESPACE_DECL
34 #endif // LLVM_LIBC_SRC_SETJMP_LONGJMP_H