summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/std')
-rw-r--r--libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr_ref.pass.cpp4
-rw-r--r--libcxx/test/std/depr/depr.auto.ptr/auto.ptr/element_type.pass.cpp3
-rw-r--r--libcxx/test/std/depr/depr.c.headers/inttypes_h.pass.cpp3
-rw-r--r--libcxx/test/std/depr/depr.c.headers/locale_h.pass.cpp2
-rw-r--r--libcxx/test/std/depr/depr.c.headers/signal_h.pass.cpp2
-rw-r--r--libcxx/test/std/depr/depr.c.headers/stdarg_h.pass.cpp1
-rw-r--r--libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp11
-rw-r--r--libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp8
-rw-r--r--libcxx/test/std/depr/depr.c.headers/time_h.pass.cpp2
-rw-r--r--libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp4
-rw-r--r--libcxx/test/std/depr/exception.unexpected/unexpected.handler/unexpected_handler.pass.cpp1
11 files changed, 28 insertions, 13 deletions
diff --git a/libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr_ref.pass.cpp b/libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr_ref.pass.cpp
index f61a28e84d4..a5db81e6c63 100644
--- a/libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr_ref.pass.cpp
+++ b/libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr_ref.pass.cpp
@@ -24,6 +24,10 @@ test()
B* p1 = new B(1);
std::auto_ptr<B> ap1(p1);
std::auto_ptr_ref<A> apr = ap1;
+ std::auto_ptr<A> ap2(apr);
+ assert(ap1.get() == nullptr);
+ assert(ap2.get() == p1);
+ ap2.release();
delete p1;
}
diff --git a/libcxx/test/std/depr/depr.auto.ptr/auto.ptr/element_type.pass.cpp b/libcxx/test/std/depr/depr.auto.ptr/auto.ptr/element_type.pass.cpp
index 2d1c2af8062..256563439a1 100644
--- a/libcxx/test/std/depr/depr.auto.ptr/auto.ptr/element_type.pass.cpp
+++ b/libcxx/test/std/depr/depr.auto.ptr/auto.ptr/element_type.pass.cpp
@@ -25,6 +25,8 @@ void
test()
{
static_assert((std::is_same<typename std::auto_ptr<T>::element_type, T>::value), "");
+ std::auto_ptr<T> p;
+ ((void)p);
}
int main()
@@ -32,5 +34,4 @@ int main()
test<int>();
test<double>();
test<void>();
- std::auto_ptr<void> p;
}
diff --git a/libcxx/test/std/depr/depr.c.headers/inttypes_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/inttypes_h.pass.cpp
index 4adf82da95e..a799aea2457 100644
--- a/libcxx/test/std/depr/depr.c.headers/inttypes_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/inttypes_h.pass.cpp
@@ -631,7 +631,8 @@
int main()
{
{
- imaxdiv_t i1 = {0};
+ imaxdiv_t i1 = {0};
+ ((void)i1);
}
intmax_t i = 0;
static_assert((std::is_same<decltype(imaxabs(i)), intmax_t>::value), "");
diff --git a/libcxx/test/std/depr/depr.c.headers/locale_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/locale_h.pass.cpp
index 6ecf5a82e8d..f5735b6ea19 100644
--- a/libcxx/test/std/depr/depr.c.headers/locale_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/locale_h.pass.cpp
@@ -42,7 +42,7 @@
int main()
{
- lconv lc;
+ lconv lc; ((void)lc);
static_assert((std::is_same<decltype(setlocale(0, "")), char*>::value), "");
static_assert((std::is_same<decltype(localeconv()), lconv*>::value), "");
}
diff --git a/libcxx/test/std/depr/depr.c.headers/signal_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/signal_h.pass.cpp
index a8ef5f993fe..83f45c9b142 100644
--- a/libcxx/test/std/depr/depr.c.headers/signal_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/signal_h.pass.cpp
@@ -50,7 +50,7 @@
int main()
{
- sig_atomic_t sig;
+ sig_atomic_t sig; ((void)sig);
typedef void (*func)(int);
static_assert((std::is_same<decltype(signal(0, (func)0)), func>::value), "");
static_assert((std::is_same<decltype(raise(0)), int>::value), "");
diff --git a/libcxx/test/std/depr/depr.c.headers/stdarg_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/stdarg_h.pass.cpp
index 7a60902529e..f7d12b1ad55 100644
--- a/libcxx/test/std/depr/depr.c.headers/stdarg_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/stdarg_h.pass.cpp
@@ -32,4 +32,5 @@
int main()
{
va_list va;
+ ((void)va);
}
diff --git a/libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp
index d4cfbc80a5c..ba6714ddfb1 100644
--- a/libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp
@@ -11,6 +11,7 @@
#include <stdio.h>
#include <type_traits>
+#include "test_macros.h"
#ifndef BUFSIZ
#error BUFSIZ not defined
@@ -78,14 +79,16 @@
#include <cstdarg>
-#pragma clang diagnostic ignored "-Wformat-zero-length"
+#pragma GCC diagnostic ignored "-Wformat-zero-length"
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // for tmpnam
int main()
{
FILE* fp = 0;
fpos_t fpos = {0};
- size_t s = 0;
+ size_t s = 0; ((void)s);
char* cp = 0;
+ char arr[] = {'a', 'b'};
va_list va;
static_assert((std::is_same<decltype(remove("")), int>::value), "");
static_assert((std::is_same<decltype(rename("","")), int>::value), "");
@@ -117,7 +120,7 @@ int main()
static_assert((std::is_same<decltype(fputs("",fp)), int>::value), "");
static_assert((std::is_same<decltype(getc(fp)), int>::value), "");
static_assert((std::is_same<decltype(getchar()), int>::value), "");
-#if _LIBCPP_STD_VER < 14
+#if TEST_STD_VER < 14
static_assert((std::is_same<decltype(gets(cp)), char*>::value), "");
#endif
static_assert((std::is_same<decltype(putc(0,fp)), int>::value), "");
@@ -125,7 +128,7 @@ int main()
static_assert((std::is_same<decltype(puts("")), int>::value), "");
static_assert((std::is_same<decltype(ungetc(0,fp)), int>::value), "");
static_assert((std::is_same<decltype(fread((void*)0,0,0,fp)), size_t>::value), "");
- static_assert((std::is_same<decltype(fwrite((const void*)0,0,0,fp)), size_t>::value), "");
+ static_assert((std::is_same<decltype(fwrite((const void*)arr,1,0,fp)), size_t>::value), "");
static_assert((std::is_same<decltype(fgetpos(fp, &fpos)), int>::value), "");
static_assert((std::is_same<decltype(fseek(fp, 0,0)), int>::value), "");
static_assert((std::is_same<decltype(fsetpos(fp, &fpos)), int>::value), "");
diff --git a/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
index 47e1527fb17..d1cc4431bc7 100644
--- a/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
@@ -34,10 +34,10 @@
int main()
{
- size_t s = 0;
- div_t d;
- ldiv_t ld;
- lldiv_t lld;
+ size_t s = 0; ((void)s);
+ div_t d; ((void)d);
+ ldiv_t ld; ((void)ld);
+ lldiv_t lld; ((void)lld);
char** endptr = 0;
static_assert((std::is_same<decltype(atof("")), double>::value), "");
static_assert((std::is_same<decltype(atoi("")), int>::value), "");
diff --git a/libcxx/test/std/depr/depr.c.headers/time_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/time_h.pass.cpp
index c468693ccb2..0d229af409b 100644
--- a/libcxx/test/std/depr/depr.c.headers/time_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/time_h.pass.cpp
@@ -22,7 +22,7 @@
int main()
{
- clock_t c = 0;
+ clock_t c = 0; ((void)c);
size_t s = 0;
time_t t = 0;
tm tmv = {0};
diff --git a/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp
index 68bea49cfe0..8d1c3b79729 100644
--- a/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp
@@ -28,6 +28,10 @@
#error WEOF not defined
#endif
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Wmissing-braces"
+#endif
+
int main()
{
mbstate_t mb = {0};
diff --git a/libcxx/test/std/depr/exception.unexpected/unexpected.handler/unexpected_handler.pass.cpp b/libcxx/test/std/depr/exception.unexpected/unexpected.handler/unexpected_handler.pass.cpp
index 7fab50081d2..5879529317e 100644
--- a/libcxx/test/std/depr/exception.unexpected/unexpected.handler/unexpected_handler.pass.cpp
+++ b/libcxx/test/std/depr/exception.unexpected/unexpected.handler/unexpected_handler.pass.cpp
@@ -16,4 +16,5 @@ void f() {}
int main()
{
std::unexpected_handler p = f;
+ ((void)p);
}
OpenPOWER on IntegriCloud