[PATCH] D25248: [libcxx] [test] Fix shadow warnings.

Stephan T. Lavavej via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 4 12:24:31 PDT 2016


STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.

Fix MSVC shadow warnings in a newly added test, by renaming local variables.


https://reviews.llvm.org/D25248

Files:
  test/std/utilities/utility/forward/move.pass.cpp


Index: test/std/utilities/utility/forward/move.pass.cpp
===================================================================
--- test/std/utilities/utility/forward/move.pass.cpp
+++ test/std/utilities/utility/forward/move.pass.cpp
@@ -52,12 +52,12 @@
 
 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,17 +105,17 @@
     }
 #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
 #if TEST_STD_VER == 11 && defined(_LIBCPP_VERSION)
     // 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
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25248.73531.patch
Type: text/x-patch
Size: 1412 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161004/c8708ab7/attachment.bin>


More information about the cfe-commits mailing list