[llvm-branch-commits] [libcxx] [libc++] Makes saturation functions privately available. (PR #89503)

Mark de Wever via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Apr 20 09:35:27 PDT 2024


================
@@ -107,6 +107,35 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Rp saturate_cast(_Tp __x) noexcept {
   return static_cast<_Rp>(__x);
 }
 
+#endif // _LIBCPP_STD_VER >= 20
+
+#if _LIBCPP_STD_VER >= 26
+
+template <__libcpp_integer _Tp>
+_LIBCPP_HIDE_FROM_ABI constexpr _Tp add_sat(_Tp __x, _Tp __y) noexcept {
+  return std::add_sat(__x, __y);
----------------
mordante wrote:

Thanks good catch!

https://github.com/llvm/llvm-project/pull/89503


More information about the llvm-branch-commits mailing list