[libc++] [ranges] Introduce _LIBCPP_AUTO_CAST(x) for auto(x).
Clang is gaining `auto(x)` support in D113393; sadly there
seems to be no feature-test macro for it. Zhihao is opening
a core issue for that macro.
Use `_LIBCPP_AUTO_CAST` where C++20 specifies we should use `auto(x)`;
stop using `__decay_copy(x)` in those places.
In fact, remove `__decay_copy` entirely. As of C++20, it's purely
a paper specification tool signifying "Return just `x`, but it was
perfect-forwarded, so we understand you're going to have to call
its move-constructor sometimes." I believe there's no reason we'd
ever need to do its operation explicitly in code.
This heisenbugs away a test failure on MinGW; see D112214.
Differential Revision: https://reviews.llvm.org/D115686
NOKEYCHECK=True
GitOrigin-RevId: cb8a0b07974eb6a6aa681c30ce694e13b33a3db5
diff --git a/include/module.modulemap b/include/module.modulemap
index 4194a7f..1dc6db4 100644
--- a/include/module.modulemap
+++ b/include/module.modulemap
@@ -921,8 +921,8 @@
module __utility {
module as_const { private header "__utility/as_const.h" }
+ module auto_cast { private header "__utility/auto_cast.h" }
module cmp { private header "__utility/cmp.h" }
- module decay_copy { private header "__utility/decay_copy.h" }
module declval { private header "__utility/declval.h" }
module exchange { private header "__utility/exchange.h" }
module forward { private header "__utility/forward.h" }