1 | //===-- is_constant_evaluated type_traits -----------------------*- 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 | //===----------------------------------------------------------------------===// |
8 | #ifndef LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_CONSTANT_EVALUATED_H |
9 | #define LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_CONSTANT_EVALUATED_H |
10 | |
11 | #include "src/__support/macros/attributes.h" |
12 | |
13 | namespace LIBC_NAMESPACE::cpp { |
14 | |
15 | LIBC_INLINE constexpr bool is_constant_evaluated() { |
16 | return __builtin_is_constant_evaluated(); |
17 | } |
18 | |
19 | } // namespace LIBC_NAMESPACE::cpp |
20 | |
21 | #endif // LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_CONSTANT_EVALUATED_H |
22 | |