mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 20:29:39 +08:00
Placate unused variable warnings uncovered by improvements to clang's -Wunused-variable
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@315809 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -18,4 +18,5 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
std::complex<double> d;
|
std::complex<double> d;
|
||||||
|
(void)d;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
std::complex<double> cd;
|
std::complex<double> cd;
|
||||||
|
(void)cd;
|
||||||
double x = sin(1.0);
|
double x = sin(1.0);
|
||||||
(void)x; // to placate scan-build
|
(void)x; // to placate scan-build
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,4 +18,5 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
std::complex<double> d;
|
std::complex<double> d;
|
||||||
|
(void)d;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,4 +14,5 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
std::complex<double> d;
|
std::complex<double> d;
|
||||||
|
(void)d;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
std::complex<double> cd;
|
std::complex<double> cd;
|
||||||
|
(void)cd;
|
||||||
double x = sin(1.0);
|
double x = sin(1.0);
|
||||||
(void)x; // to placate scan-build
|
(void)x; // to placate scan-build
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,4 +19,5 @@ int main()
|
|||||||
using std::experimental::optional;
|
using std::experimental::optional;
|
||||||
|
|
||||||
std::initializer_list<int> list;
|
std::initializer_list<int> list;
|
||||||
|
(void)list;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,4 +16,5 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
std::tuple<int> x(1);
|
std::tuple<int> x(1);
|
||||||
|
(void)x;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ void
|
|||||||
test()
|
test()
|
||||||
{
|
{
|
||||||
std::move_iterator<It> r;
|
std::move_iterator<It> r;
|
||||||
|
(void)r;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
@@ -38,6 +39,7 @@ int main()
|
|||||||
#if TEST_STD_VER > 14
|
#if TEST_STD_VER > 14
|
||||||
{
|
{
|
||||||
constexpr std::move_iterator<const char *> it;
|
constexpr std::move_iterator<const char *> it;
|
||||||
|
(void)it;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ void
|
|||||||
test()
|
test()
|
||||||
{
|
{
|
||||||
std::reverse_iterator<It> r;
|
std::reverse_iterator<It> r;
|
||||||
|
(void)r;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
@@ -37,6 +38,7 @@ int main()
|
|||||||
#if TEST_STD_VER > 14
|
#if TEST_STD_VER > 14
|
||||||
{
|
{
|
||||||
constexpr std::reverse_iterator<const char *> it;
|
constexpr std::reverse_iterator<const char *> it;
|
||||||
|
(void)it;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ template <typename T, bool isTrivial = std::is_trivially_default_constructible_v
|
|||||||
struct test_trivial {
|
struct test_trivial {
|
||||||
void operator ()() const {
|
void operator ()() const {
|
||||||
constexpr std::istream_iterator<T> it;
|
constexpr std::istream_iterator<T> it;
|
||||||
|
(void)it;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -50,6 +51,7 @@ int main()
|
|||||||
assert(it == T());
|
assert(it == T());
|
||||||
#if TEST_STD_VER >= 11
|
#if TEST_STD_VER >= 11
|
||||||
constexpr T it2;
|
constexpr T it2;
|
||||||
|
(void)it2;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ int main()
|
|||||||
assert(it == T());
|
assert(it == T());
|
||||||
#if TEST_STD_VER >= 11
|
#if TEST_STD_VER >= 11
|
||||||
constexpr T it2;
|
constexpr T it2;
|
||||||
|
(void)it2;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@@ -38,6 +39,7 @@ int main()
|
|||||||
assert(it == T());
|
assert(it == T());
|
||||||
#if TEST_STD_VER >= 11
|
#if TEST_STD_VER >= 11
|
||||||
constexpr T it2;
|
constexpr T it2;
|
||||||
|
(void)it2;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,5 +57,6 @@ int main()
|
|||||||
A test1 = {3, 2, 1};
|
A test1 = {3, 2, 1};
|
||||||
#if TEST_STD_VER > 11
|
#if TEST_STD_VER > 11
|
||||||
constexpr B test2 = {3, 2, 1};
|
constexpr B test2 = {3, 2, 1};
|
||||||
|
(void)test2;
|
||||||
#endif // TEST_STD_VER > 11
|
#endif // TEST_STD_VER > 11
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,5 +55,6 @@ int main()
|
|||||||
A test1 = {3, 2, 1};
|
A test1 = {3, 2, 1};
|
||||||
#if TEST_STD_VER > 11
|
#if TEST_STD_VER > 11
|
||||||
constexpr B test2 = {3, 2, 1};
|
constexpr B test2 = {3, 2, 1};
|
||||||
|
(void)test2;
|
||||||
#endif // TEST_STD_VER > 11
|
#endif // TEST_STD_VER > 11
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
std::complex<double> cd;
|
std::complex<double> cd;
|
||||||
|
(void)cd;
|
||||||
double x = std::sin(0);
|
double x = std::sin(0);
|
||||||
((void)x); // Prevent unused warning
|
((void)x); // Prevent unused warning
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,4 +14,5 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
std::complex<double> d;
|
std::complex<double> d;
|
||||||
|
(void)d;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,10 +20,12 @@ int main()
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
std::once_flag f;
|
std::once_flag f;
|
||||||
|
(void)f;
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
constexpr std::once_flag f;
|
constexpr std::once_flag f;
|
||||||
|
(void)f;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,4 +19,5 @@ int main()
|
|||||||
using std::optional;
|
using std::optional;
|
||||||
|
|
||||||
std::initializer_list<int> list;
|
std::initializer_list<int> list;
|
||||||
|
(void)list;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ int main()
|
|||||||
#if TEST_STD_VER > 11
|
#if TEST_STD_VER > 11
|
||||||
{
|
{
|
||||||
constexpr std::tuple<Empty> t0{Empty()};
|
constexpr std::tuple<Empty> t0{Empty()};
|
||||||
|
(void)t0;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
constexpr std::tuple<A, A> t(3, 2);
|
constexpr std::tuple<A, A> t(3, 2);
|
||||||
|
|||||||
@@ -102,6 +102,8 @@ int main()
|
|||||||
using T = NonDefaultConstructible<>;
|
using T = NonDefaultConstructible<>;
|
||||||
T v(42);
|
T v(42);
|
||||||
std::tuple<T, T> t(v, v);
|
std::tuple<T, T> t(v, v);
|
||||||
|
(void)t;
|
||||||
std::tuple<T, T> t2(42, 42);
|
std::tuple<T, T> t2(42, 42);
|
||||||
|
(void)t2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ int main()
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
std::tuple<> t;
|
std::tuple<> t;
|
||||||
|
(void)t;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::tuple<int> t;
|
std::tuple<int> t;
|
||||||
@@ -88,6 +89,7 @@ int main()
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
constexpr std::tuple<> t;
|
constexpr std::tuple<> t;
|
||||||
|
(void)t;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
constexpr std::tuple<int> t;
|
constexpr std::tuple<int> t;
|
||||||
|
|||||||
@@ -17,5 +17,6 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
std::initializer_list<int> x;
|
std::initializer_list<int> x;
|
||||||
|
(void)x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user