[PATCH] D41748: [libcxx] [test] Fix Xxx_scan tests using nonstandard things and MSVC++ warnings

Casey Carter via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 4 18:25:09 PST 2018

CaseyCarter added inline comments.

Comment at: test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp:31
-template <class T = void>
-struct identity : std::unary_function<T, T>
-    constexpr const T& operator()(const T& x) const { return x;}
-template <>
-struct identity<void>
-    template <class T>
-    constexpr auto operator()(T&& x) const
-    _NOEXCEPT_(noexcept(_VSTD::forward<T>(x)))
-    -> decltype        (_VSTD::forward<T>(x))
-        { return        _VSTD::forward<T>(x); }
+const auto identity = [](auto&& x) { return std::forward<decltype(x)>(x); };
Pre-existing: the identity transformation is an extremely poor choice for these `transform_foo` tests since failure to apply the transformation exactly once to each element does not affect the result of the algorithm.


More information about the cfe-commits mailing list