[libcxx] r283618 - Fix shadow warnings. Patch from STL at microsoft.com

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 7 15:10:36 PDT 2016


Author: ericwf
Date: Fri Oct  7 17:10:35 2016
New Revision: 283618

URL: http://llvm.org/viewvc/llvm-project?rev=283618&view=rev
Log:
Fix shadow warnings. Patch from STL at microsoft.com

Modified:
    libcxx/trunk/test/std/utilities/utility/forward/move.pass.cpp

Modified: libcxx/trunk/test/std/utilities/utility/forward/move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/utility/forward/move.pass.cpp?rev=283618&r1=283617&r2=283618&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/utility/forward/move.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/utility/forward/move.pass.cpp Fri Oct  7 17:10:35 2016
@@ -52,12 +52,12 @@ struct A {
 
 constexpr bool test_constexpr_move() {
 #if TEST_STD_VER > 11
-    int x = 42;
-    const int cx = x;
-    return std::move(x) == 42
-        && std::move(cx) == 42
-        && std::move(static_cast<int&&>(x)) == 42
-        && std::move(static_cast<int const&&>(x)) == 42;
+    int y = 42;
+    const int cy = y;
+    return std::move(y) == 42
+        && std::move(cy) == 42
+        && std::move(static_cast<int&&>(y)) == 42
+        && std::move(static_cast<int const&&>(y)) == 42;
 #else
     return true;
 #endif
@@ -105,8 +105,8 @@ int main()
     }
 #if TEST_STD_VER > 11
     {
-        constexpr int x = 42;
-        static_assert(std::move(x) == 42, "");
+        constexpr int y = 42;
+        static_assert(std::move(y) == 42, "");
         static_assert(test_constexpr_move(), "");
     }
 #endif
@@ -114,8 +114,8 @@ int main()
     // Test that std::forward is constexpr in C++11. This is an extension
     // provided by both libc++ and libstdc++.
     {
-        constexpr int x = 42;
-        static_assert(std::move(x) == 42, "");
+        constexpr int y = 42;
+        static_assert(std::move(y) == 42, "");
     }
 #endif
 }




More information about the cfe-commits mailing list