diff --git a/libcxx/include/__charconv/from_chars_floating_point.h b/libcxx/include/__charconv/from_chars_floating_point.h index 2860b0e8da83af..5cd3fc4a41ea1d 100644 --- a/libcxx/include/__charconv/from_chars_floating_point.h +++ b/libcxx/include/__charconv/from_chars_floating_point.h @@ -37,13 +37,13 @@ struct __from_chars_result { template _LIBCPP_EXPORTED_FROM_ABI __from_chars_result<_Fp> __from_chars_floating_point( - [[clang::noescape]] const char* __first, [[clang::noescape]] const char* __last, chars_format __fmt); + _LIBCPP_NOESCAPE const char* __first, _LIBCPP_NOESCAPE const char* __last, chars_format __fmt); extern template __from_chars_result __from_chars_floating_point( - [[clang::noescape]] const char* __first, [[clang::noescape]] const char* __last, chars_format __fmt); + _LIBCPP_NOESCAPE const char* __first, _LIBCPP_NOESCAPE const char* __last, chars_format __fmt); extern template __from_chars_result __from_chars_floating_point( - [[clang::noescape]] const char* __first, [[clang::noescape]] const char* __last, chars_format __fmt); + _LIBCPP_NOESCAPE const char* __first, _LIBCPP_NOESCAPE const char* __last, chars_format __fmt); template _LIBCPP_HIDE_FROM_ABI from_chars_result diff --git a/libcxx/include/__config b/libcxx/include/__config index fcba56f7e3d5b1..fca1a01851e81e 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -1167,6 +1167,12 @@ typedef __char32_t char32_t; # define _LIBCPP_LIFETIMEBOUND # endif +# if __has_cpp_attribute(_Clang::__noescape__) +# define _LIBCPP_NOESCAPE [[_Clang::__noescape__]] +# else +# define _LIBCPP_NOESCAPE +# endif + # if __has_attribute(__nodebug__) # define _LIBCPP_NODEBUG __attribute__((__nodebug__)) # else diff --git a/libcxx/src/charconv.cpp b/libcxx/src/charconv.cpp index 3fe0afec0e283c..5e8cb7d97703b4 100644 --- a/libcxx/src/charconv.cpp +++ b/libcxx/src/charconv.cpp @@ -77,13 +77,13 @@ to_chars_result to_chars(char* __first, char* __last, long double __value, chars template __from_chars_result<_Fp> __from_chars_floating_point( - [[clang::noescape]] const char* __first, [[clang::noescape]] const char* __last, chars_format __fmt) { + _LIBCPP_NOESCAPE const char* __first, _LIBCPP_NOESCAPE const char* __last, chars_format __fmt) { return std::__from_chars_floating_point_impl<_Fp>(__first, __last, __fmt); } template __from_chars_result __from_chars_floating_point( - [[clang::noescape]] const char* __first, [[clang::noescape]] const char* __last, chars_format __fmt); + _LIBCPP_NOESCAPE const char* __first, _LIBCPP_NOESCAPE const char* __last, chars_format __fmt); template __from_chars_result __from_chars_floating_point( - [[clang::noescape]] const char* __first, [[clang::noescape]] const char* __last, chars_format __fmt); + _LIBCPP_NOESCAPE const char* __first, _LIBCPP_NOESCAPE const char* __last, chars_format __fmt); _LIBCPP_END_NAMESPACE_STD