[libc++] basic_string::resize_and_overwrite: Adopt LWG3645 (Not voted in yet)

Adopt LWG3645, which fixes the value categories of basic_string::resize_and_overwrite
https://timsong-cpp.github.io/lwg-issues/3645

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D116815

NOKEYCHECK=True
GitOrigin-RevId: 48224475222d14e6f661d649f4363dcc197cc7ef
diff --git a/include/string b/include/string
index c4f2b00..b2eef64 100644
--- a/include/string
+++ b/include/string
@@ -979,8 +979,7 @@
     _LIBCPP_HIDE_FROM_ABI constexpr
     void resize_and_overwrite(size_type __n, _Op __op) {
       __resize_default_init(__n);
-      pointer __data = data();
-      __erase_to_end(_VSTD::move(__op)(__data, __n));
+      __erase_to_end(_VSTD::move(__op)(data(), _LIBCPP_AUTO_CAST(__n)));
     }
 #endif