summaryrefslogtreecommitdiffstats
path: root/libcxx/include/__config
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include/__config')
-rw-r--r--libcxx/include/__config15
1 files changed, 15 insertions, 0 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config
index d6217234a8b..f62859f3401 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -121,6 +121,9 @@
#ifndef __has_feature
#define __has_feature(__x) 0
#endif
+#ifndef __has_cpp_attribute
+#define __has_cpp_attribute(__x) 0
+#endif
// '__is_identifier' returns '0' if '__x' is a reserved identifier provided by
// the compiler and '1' otherwise.
#ifndef __is_identifier
@@ -951,6 +954,18 @@ template <unsigned> struct __static_assert_check {};
#define _LIBCPP_CONSTEXPR_AFTER_CXX14
#endif
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
+#define _LIBCPP_CONSTEXPR_AFTER_CXX17 constexpr
+#else
+#define _LIBCPP_CONSTEXPR_AFTER_CXX17
+#endif
+
+#if __has_cpp_attribute(nodiscard) && _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17)
+#define _LIBCPP_NODISCARD_AFTER_CXX17 [[nodiscard]]
+#else
+#define _LIBCPP_NODISCARD_AFTER_CXX17
+#endif
+
// FIXME: Remove all usages of this macro once compilers catch up.
#if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606L)
# define _LIBCPP_HAS_NO_INLINE_VARIABLES
OpenPOWER on IntegriCloud