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:
@@ -91,6 +91,8 @@ int main() {
|
||||
}
|
||||
{
|
||||
std::tuple<A&&> t(std::forward_as_tuple(A{}));
|
||||
((void)t);
|
||||
std::tuple<ExplicitA&&> t2(std::forward_as_tuple(ExplicitA{}));
|
||||
((void)t2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,30 +47,30 @@ struct ExplicitDerived : std::tuple<T> {
|
||||
|
||||
int main() {
|
||||
{
|
||||
std::tuple<Explicit> foo = Derived<int>{42};
|
||||
std::tuple<Explicit> foo = Derived<int>{42}; ((void)foo);
|
||||
assert(count == 1);
|
||||
std::tuple<Explicit> bar(Derived<int>{42});
|
||||
std::tuple<Explicit> bar(Derived<int>{42}); ((void)bar);
|
||||
assert(count == 2);
|
||||
}
|
||||
count = 0;
|
||||
{
|
||||
std::tuple<Implicit> foo = Derived<int>{42};
|
||||
std::tuple<Implicit> foo = Derived<int>{42}; ((void)foo);
|
||||
assert(count == 1);
|
||||
std::tuple<Implicit> bar(Derived<int>{42});
|
||||
std::tuple<Implicit> bar(Derived<int>{42}); ((void)bar);
|
||||
assert(count == 2);
|
||||
}
|
||||
count = 0;
|
||||
{
|
||||
static_assert(!std::is_convertible<
|
||||
ExplicitDerived<int>, std::tuple<Explicit>>::value, "");
|
||||
std::tuple<Explicit> bar(ExplicitDerived<int>{42});
|
||||
std::tuple<Explicit> bar(ExplicitDerived<int>{42}); ((void)bar);
|
||||
assert(count == 1);
|
||||
}
|
||||
count = 0;
|
||||
{
|
||||
// FIXME: Libc++ incorrectly rejects this code.
|
||||
#ifndef _LIBCPP_VERSION
|
||||
std::tuple<Implicit> foo = ExplicitDerived<int>{42};
|
||||
std::tuple<Implicit> foo = ExplicitDerived<int>{42}; ((void)foo);
|
||||
static_assert(std::is_convertible<
|
||||
ExplicitDerived<int>, std::tuple<Implicit>>::value,
|
||||
"correct STLs accept this");
|
||||
@@ -80,7 +80,7 @@ int main() {
|
||||
"libc++ incorrectly rejects this");
|
||||
#endif
|
||||
assert(count == 0);
|
||||
std::tuple<Implicit> bar(ExplicitDerived<int>{42});
|
||||
std::tuple<Implicit> bar(ExplicitDerived<int>{42}); ((void)bar);
|
||||
assert(count == 1);
|
||||
}
|
||||
count = 0;
|
||||
|
||||
@@ -82,6 +82,7 @@ int main()
|
||||
{
|
||||
// check that the literal '0' can implicitly initialize a stored pointer.
|
||||
std::tuple<int*> t = 0;
|
||||
assert(std::get<0>(t) == nullptr);
|
||||
}
|
||||
{
|
||||
std::tuple<int> t(2);
|
||||
|
||||
@@ -29,7 +29,7 @@ struct ConstructsWithTupleLeaf
|
||||
ConstructsWithTupleLeaf(ConstructsWithTupleLeaf &&) {}
|
||||
|
||||
template <class T>
|
||||
ConstructsWithTupleLeaf(T t) {
|
||||
ConstructsWithTupleLeaf(T) {
|
||||
static_assert(!std::is_same<T, T>::value,
|
||||
"Constructor instantiated for type other than int");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user