Fix shadow warnings. Patch from STL@microsoft.com

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283618 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2016-10-07 22:10:35 +00:00
parent 2c429bee79
commit ee0db89aee

View File

@@ -52,12 +52,12 @@ struct A {
constexpr bool test_constexpr_move() { constexpr bool test_constexpr_move() {
#if TEST_STD_VER > 11 #if TEST_STD_VER > 11
int x = 42; int y = 42;
const int cx = x; const int cy = y;
return std::move(x) == 42 return std::move(y) == 42
&& std::move(cx) == 42 && std::move(cy) == 42
&& std::move(static_cast<int&&>(x)) == 42 && std::move(static_cast<int&&>(y)) == 42
&& std::move(static_cast<int const&&>(x)) == 42; && std::move(static_cast<int const&&>(y)) == 42;
#else #else
return true; return true;
#endif #endif
@@ -105,8 +105,8 @@ int main()
} }
#if TEST_STD_VER > 11 #if TEST_STD_VER > 11
{ {
constexpr int x = 42; constexpr int y = 42;
static_assert(std::move(x) == 42, ""); static_assert(std::move(y) == 42, "");
static_assert(test_constexpr_move(), ""); static_assert(test_constexpr_move(), "");
} }
#endif #endif
@@ -114,8 +114,8 @@ int main()
// Test that std::forward is constexpr in C++11. This is an extension // Test that std::forward is constexpr in C++11. This is an extension
// provided by both libc++ and libstdc++. // provided by both libc++ and libstdc++.
{ {
constexpr int x = 42; constexpr int y = 42;
static_assert(std::move(x) == 42, ""); static_assert(std::move(y) == 42, "");
} }
#endif #endif
} }