Fix unused parameters and variables

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290459 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2016-12-23 23:37:52 +00:00
parent 17a98d8a92
commit 0e5ebbc77c
120 changed files with 307 additions and 268 deletions

View File

@@ -21,4 +21,5 @@ int main()
typedef std::unordered_multimap<int, int> M2;
M2::iterator i;
M1::iterator j = i;
((void)j);
}

View File

@@ -47,7 +47,10 @@ int main()
};
C c(a, a + sizeof(a)/sizeof(a[0]));
C::const_iterator i = c.find(2);
C::const_iterator i_next = i;
++i_next;
C::iterator j = c.erase(i);
assert(j == i_next);
assert(c.size() == 5);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
@@ -93,7 +96,10 @@ int main()
};
C c(a, a + sizeof(a)/sizeof(a[0]));
C::const_iterator i = c.find(2);
C::const_iterator i_next = i;
++i_next;
C::iterator j = c.erase(i);
assert(j == i_next);
assert(c.size() == 5);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;

View File

@@ -45,7 +45,11 @@ int main()
};
C c(a, a + sizeof(a)/sizeof(a[0]));
C::const_iterator i = c.find(2);
C::const_iterator i_next = i;
++i_next;
C::iterator j = c.erase(i);
assert(j == i_next);
assert(c.size() == 5);
assert(c.count(1) == 2);
assert(c.count(2) == 1);
@@ -68,7 +72,10 @@ int main()
};
C c(a, a + sizeof(a)/sizeof(a[0]));
C::const_iterator i = c.find(2);
C::const_iterator i_next = i;
++i_next;
C::iterator j = c.erase(i);
assert(j == i_next);
assert(c.size() == 5);
assert(c.count(1) == 2);
assert(c.count(2) == 1);

View File

@@ -21,4 +21,5 @@ int main()
typedef std::unordered_multiset<int> M2;
M2::iterator i;
M1::iterator j = i;
((void)j);
}

View File

@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -29,23 +31,12 @@
int main()
{
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::unordered_multiset<int,
test_hash<std::hash<int> >,
test_compare<std::equal_to<int> >,
test_allocator<int>
> C;
typedef int P;
P a[] =
{
P(1),
P(2),
P(3),
P(4),
P(1),
P(2)
};
C c0(7,
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9),
@@ -105,23 +96,12 @@ int main()
assert(c0.empty());
}
#if TEST_STD_VER >= 11
{
typedef std::unordered_multiset<int,
test_hash<std::hash<int> >,
test_compare<std::equal_to<int> >,
min_allocator<int>
> C;
typedef int P;
P a[] =
{
P(1),
P(2),
P(3),
P(4),
P(1),
P(2)
};
C c0(7,
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9),
@@ -181,7 +161,6 @@ int main()
assert(c0.empty());
}
#endif
#if _LIBCPP_DEBUG >= 1
{
std::unordered_multiset<int> s1 = {1, 2, 3};
@@ -193,5 +172,4 @@ int main()
assert(s2.size() == 2);
}
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}

View File

@@ -45,7 +45,11 @@ int main()
};
C c(a, a + sizeof(a)/sizeof(a[0]));
C::const_iterator i = c.find(2);
C::const_iterator i_next = i;
++i_next;
C::iterator j = c.erase(i);
assert(j == i_next);
assert(c.size() == 3);
assert(c.count(1) == 1);
assert(c.count(3) == 1);
@@ -66,7 +70,11 @@ int main()
};
C c(a, a + sizeof(a)/sizeof(a[0]));
C::const_iterator i = c.find(2);
C::const_iterator i_next = i;
++i_next;
C::iterator j = c.erase(i);
assert(j == i_next);
assert(c.size() == 3);
assert(c.count(1) == 1);
assert(c.count(3) == 1);

View File

@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -29,23 +31,12 @@
int main()
{
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::unordered_set<int,
test_hash<std::hash<int> >,
test_compare<std::equal_to<int> >,
test_allocator<int>
> C;
typedef int P;
P a[] =
{
P(1),
P(2),
P(3),
P(4),
P(1),
P(2)
};
C c0(7,
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9),
@@ -105,23 +96,12 @@ int main()
assert(c0.empty());
}
#if TEST_STD_VER >= 11
{
typedef std::unordered_set<int,
test_hash<std::hash<int> >,
test_compare<std::equal_to<int> >,
min_allocator<int>
> C;
typedef int P;
P a[] =
{
P(1),
P(2),
P(3),
P(4),
P(1),
P(2)
};
C c0(7,
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9),
@@ -181,7 +161,6 @@ int main()
assert(c0.empty());
}
#endif
#if _LIBCPP_DEBUG >= 1
{
std::unordered_set<int> s1 = {1, 2, 3};
@@ -193,5 +172,4 @@ int main()
assert(s2.size() == 2);
}
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}