mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 10:07:41 +08:00
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
This commit is contained in:
@@ -62,6 +62,7 @@ test_larger_sorts(unsigned N)
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
std::partial_sort(&i, &i, &i);
|
std::partial_sort(&i, &i, &i);
|
||||||
assert(i == 0);
|
assert(i == 0);
|
||||||
@@ -73,6 +74,7 @@ int main()
|
|||||||
test_larger_sorts(997);
|
test_larger_sorts(997);
|
||||||
test_larger_sorts(1000);
|
test_larger_sorts(1000);
|
||||||
test_larger_sorts(1009);
|
test_larger_sorts(1009);
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
{
|
{
|
||||||
|
@@ -70,7 +70,7 @@ int main()
|
|||||||
std::multiset<int>::const_iterator k = i;
|
std::multiset<int>::const_iterator k = i;
|
||||||
assert(i == k);
|
assert(i == k);
|
||||||
for (int j = 1; j <= 8; ++j)
|
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);
|
assert(*i == j);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@@ -151,7 +151,7 @@ int main()
|
|||||||
std::multiset<int, std::less<int>, min_allocator<int>>::const_iterator k = i;
|
std::multiset<int, std::less<int>, min_allocator<int>>::const_iterator k = i;
|
||||||
assert(i == k);
|
assert(i == k);
|
||||||
for (int j = 1; j <= 8; ++j)
|
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);
|
assert(*i == j);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
{
|
||||||
typedef int V;
|
typedef int V;
|
||||||
V ar[] =
|
V ar[] =
|
||||||
{
|
{
|
||||||
@@ -55,6 +56,7 @@ int main()
|
|||||||
assert(*next(m.begin(), 6) == 3);
|
assert(*next(m.begin(), 6) == 3);
|
||||||
assert(*next(m.begin(), 7) == 3);
|
assert(*next(m.begin(), 7) == 3);
|
||||||
assert(*next(m.begin(), 8) == 3);
|
assert(*next(m.begin(), 8) == 3);
|
||||||
|
}
|
||||||
#if _LIBCPP_STD_VER > 11
|
#if _LIBCPP_STD_VER > 11
|
||||||
{
|
{
|
||||||
typedef int V;
|
typedef int V;
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
{
|
||||||
typedef int V;
|
typedef int V;
|
||||||
V ar[] =
|
V ar[] =
|
||||||
{
|
{
|
||||||
@@ -53,6 +54,7 @@ int main()
|
|||||||
assert(*m.begin() == 1);
|
assert(*m.begin() == 1);
|
||||||
assert(*next(m.begin()) == 2);
|
assert(*next(m.begin()) == 2);
|
||||||
assert(*next(m.begin(), 2) == 3);
|
assert(*next(m.begin(), 2) == 3);
|
||||||
|
}
|
||||||
#if _LIBCPP_STD_VER > 11
|
#if _LIBCPP_STD_VER > 11
|
||||||
{
|
{
|
||||||
typedef int V;
|
typedef int V;
|
||||||
|
@@ -46,10 +46,10 @@ int main()
|
|||||||
{
|
{
|
||||||
typedef std::unique_ptr<int, D2> P;
|
typedef std::unique_ptr<int, D2> P;
|
||||||
static_assert(std::is_same<P::pointer, int*>::value, "");
|
static_assert(std::is_same<P::pointer, int*>::value, "");
|
||||||
|
}
|
||||||
{
|
{
|
||||||
typedef std::unique_ptr<int, D3> P;
|
typedef std::unique_ptr<int, D3> P;
|
||||||
static_assert(std::is_same<P::pointer, int*>::value, "");
|
static_assert(std::is_same<P::pointer, int*>::value, "");
|
||||||
}}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user