We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7baf4bd commit 8ef0c50Copy full SHA for 8ef0c50
libc/src/__support/CPP/type_traits/is_constant_evaluated.h
@@ -15,7 +15,11 @@ namespace LIBC_NAMESPACE_DECL {
15
namespace cpp {
16
17
LIBC_INLINE constexpr bool is_constant_evaluated() {
18
+#if LIBC_HAS_BUILTIN(__builtin_is_constant_evaluated)
19
return __builtin_is_constant_evaluated();
20
+#else
21
+ return false;
22
+#endif
23
}
24
25
} // namespace cpp
libc/src/__support/macros/attributes.h
@@ -48,4 +48,10 @@
48
#define LIBC_PREFERED_TYPE(TYPE)
49
#endif
50
51
+#ifndef __has_builtin
52
+#define LIBC_HAS_BUILTIN(X) 0
53
54
+#define LIBC_HAS_BUILTIN(X) __has_builtin(X)
55
56
+
57
#endif // LLVM_LIBC_SRC___SUPPORT_MACROS_ATTRIBUTES_H
0 commit comments