From 849c551745a9be4c373c3d705e8e98a444a9d07c Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Thu, 28 Apr 2016 02:45:11 +0000 Subject: [PATCH] Add braces, move braces, and rename variables to avoid shadowing. Patch from STL@microsoft.com git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267844 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../alg.sort/partial.sort/partial_sort_comp.pass.cpp | 2 ++ test/std/containers/associative/multiset/iterator.pass.cpp | 4 ++-- .../multiset/multiset.cons/iter_iter_alloc.pass.cpp | 2 ++ .../associative/set/set.cons/iter_iter_alloc.pass.cpp | 2 ++ .../memory/unique.ptr/unique.ptr.single/pointer_type.pass.cpp | 4 ++-- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp index d822f6c38..4b7c5ee64 100644 --- a/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp @@ -62,6 +62,7 @@ test_larger_sorts(unsigned N) int main() { + { int i = 0; std::partial_sort(&i, &i, &i); assert(i == 0); @@ -73,6 +74,7 @@ int main() test_larger_sorts(997); test_larger_sorts(1000); test_larger_sorts(1009); + } #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { diff --git a/test/std/containers/associative/multiset/iterator.pass.cpp b/test/std/containers/associative/multiset/iterator.pass.cpp index d1f0ecfd6..8874272db 100644 --- a/test/std/containers/associative/multiset/iterator.pass.cpp +++ b/test/std/containers/associative/multiset/iterator.pass.cpp @@ -70,7 +70,7 @@ int main() std::multiset::const_iterator k = i; assert(i == k); for (int j = 1; j <= 8; ++j) - for (int k = 0; k < 3; ++k, ++i) + for (int n = 0; n < 3; ++n, ++i) assert(*i == j); } { @@ -151,7 +151,7 @@ int main() std::multiset, min_allocator>::const_iterator k = i; assert(i == k); for (int j = 1; j <= 8; ++j) - for (int k = 0; k < 3; ++k, ++i) + for (int n = 0; n < 3; ++n, ++i) assert(*i == j); } { diff --git a/test/std/containers/associative/multiset/multiset.cons/iter_iter_alloc.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/iter_iter_alloc.pass.cpp index 4ed00c712..4313f46a0 100644 --- a/test/std/containers/associative/multiset/multiset.cons/iter_iter_alloc.pass.cpp +++ b/test/std/containers/associative/multiset/multiset.cons/iter_iter_alloc.pass.cpp @@ -24,6 +24,7 @@ int main() { + { typedef int V; V ar[] = { @@ -55,6 +56,7 @@ int main() assert(*next(m.begin(), 6) == 3); assert(*next(m.begin(), 7) == 3); assert(*next(m.begin(), 8) == 3); + } #if _LIBCPP_STD_VER > 11 { typedef int V; diff --git a/test/std/containers/associative/set/set.cons/iter_iter_alloc.pass.cpp b/test/std/containers/associative/set/set.cons/iter_iter_alloc.pass.cpp index 5ccb6e5cb..077a749ca 100644 --- a/test/std/containers/associative/set/set.cons/iter_iter_alloc.pass.cpp +++ b/test/std/containers/associative/set/set.cons/iter_iter_alloc.pass.cpp @@ -28,6 +28,7 @@ int main() { + { typedef int V; V ar[] = { @@ -53,6 +54,7 @@ int main() assert(*m.begin() == 1); assert(*next(m.begin()) == 2); assert(*next(m.begin(), 2) == 3); + } #if _LIBCPP_STD_VER > 11 { typedef int V; diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/pointer_type.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/pointer_type.pass.cpp index 566b058b8..380f2e100 100644 --- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/pointer_type.pass.cpp +++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/pointer_type.pass.cpp @@ -46,10 +46,10 @@ int main() { typedef std::unique_ptr P; static_assert(std::is_same::value, ""); - + } { typedef std::unique_ptr P; static_assert(std::is_same::value, ""); - }} + } #endif }