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

@@ -28,4 +28,5 @@ int main()
C::iterator i = c.end();
T j = *i;
assert(false);
((void)j);
}

View File

@@ -31,5 +31,5 @@ int main()
assert(myconv.converted() == 4);
// move construct a new converter and make sure the state is the same.
Myconv myconv2(std::move(myconv));
assert(myconv2.converted() == 4);
assert(myconv2.converted() == old_converted);
}

View File

@@ -23,11 +23,10 @@
#include <cmath>
constexpr bool a = std::__libcpp_isnan(0.);
constexpr bool b = std::__libcpp_isinf(0.0);
constexpr bool c = std::__libcpp_isfinite(0.0);
static_assert(std::__libcpp_isnan(0.) == false, "");
static_assert(std::__libcpp_isinf(0.0) == false, "");
static_assert(std::__libcpp_isfinite(0.0) == true, "");
int main()
{
return 0;
}

View File

@@ -18,5 +18,7 @@
int main()
{
std::complex<double> cd;
((void)cd);
double x = std::sin(0);
((void)x);
}

View File

@@ -659,11 +659,11 @@ class Configuration(object):
# These warnings should be enabled in order to support the MSVC
# team using the test suite; They enable the warnings below and
# expect the test suite to be clean.
# FIXME: Re-enable this after fixing remaining occurrences.
self.cxx.addWarningFlagIfSupported('-Wno-sign-compare')
self.cxx.addWarningFlagIfSupported('-Wunused-variable')
self.cxx.addWarningFlagIfSupported('-Wunused-parameter')
# FIXME: Enable the two warnings below.
self.cxx.addWarningFlagIfSupported('-Wno-unused-variable')
self.cxx.addWarningFlagIfSupported('-Wno-unused-parameter')
self.cxx.addWarningFlagIfSupported('-Wno-conversion')
# TODO(EricWF) Remove the unused warnings once the test suite
# compiles clean with them.
self.cxx.addWarningFlagIfSupported('-Wno-unused-local-typedef')

View File

@@ -266,6 +266,7 @@ void test_derived_from_ref_wrap() {
auto& ret2 = std::__invoke(get_fn, d);
auto& cret2 = std::__invoke_constexpr(get_fn, d);
assert(&ret2 == &x);
assert(&cret2 == &x);
auto& ret3 = std::__invoke(get_fn, r2);
assert(&ret3 == &x);
}
@@ -367,4 +368,4 @@ int main() {
test_derived_from_ref_wrap();
#endif
}
}