diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:47:26 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:47:26 +0000 |
commit | 51072bd6bf79ef2bc6a922079bff57c31c1effbc (patch) | |
tree | 91a2effbc9e6f80bdbbf9eb70e06c51ad0867ea0 /test/std/depr | |
parent | bb5e33f003797b67974a8893f7f2930fc51b8210 (diff) |
Notes
Diffstat (limited to 'test/std/depr')
24 files changed, 124 insertions, 145 deletions
diff --git a/test/std/depr/depr.c.headers/extern_c.pass.cpp b/test/std/depr/depr.c.headers/extern_c.pass.cpp deleted file mode 100644 index d4d8b5fafdde0..0000000000000 --- a/test/std/depr/depr.c.headers/extern_c.pass.cpp +++ /dev/null @@ -1,43 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// Sometimes C++'s <foo.h> headers get included within extern "C" contexts. This -// is ill-formed (no diagnostic required), per [using.headers]p3, but we permit -// it as an extension. - -extern "C" { -#include <assert.h> -// complex.h is not supported in extern "C". -#include <ctype.h> -#include <errno.h> -#include <fenv.h> -#include <float.h> -#include <inttypes.h> -#include <iso646.h> -#include <limits.h> -#include <locale.h> -#include <math.h> -#include <setjmp.h> -#include <signal.h> -#include <stdalign.h> -#include <stdarg.h> -#include <stdbool.h> -#include <stddef.h> -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -// tgmath.h is not supported in extern "C". -#include <time.h> -// FIXME: #include <uchar.h> -#include <wchar.h> -#include <wctype.h> -} - -int main() {} diff --git a/test/std/depr/depr.c.headers/fenv_h.pass.cpp b/test/std/depr/depr.c.headers/fenv_h.pass.cpp index f2fcf4914cfd4..0da4c9d86b2d0 100644 --- a/test/std/depr/depr.c.headers/fenv_h.pass.cpp +++ b/test/std/depr/depr.c.headers/fenv_h.pass.cpp @@ -60,7 +60,7 @@ int main() { - fenv_t fenv = {0}; + fenv_t fenv = {}; fexcept_t fex = 0; static_assert((std::is_same<decltype(feclearexcept(0)), int>::value), ""); static_assert((std::is_same<decltype(fegetexceptflag(&fex, 0)), int>::value), ""); diff --git a/test/std/depr/depr.c.headers/inttypes_h.pass.cpp b/test/std/depr/depr.c.headers/inttypes_h.pass.cpp index 637cf72287b8a..ff045a913fdb3 100644 --- a/test/std/depr/depr.c.headers/inttypes_h.pass.cpp +++ b/test/std/depr/depr.c.headers/inttypes_h.pass.cpp @@ -917,7 +917,7 @@ int main() uintmax_t i4 = 0; } { - imaxdiv_t i1 = {0}; + imaxdiv_t i1 = {}; } intmax_t i = 0; static_assert((std::is_same<decltype(imaxabs(i)), intmax_t>::value), ""); diff --git a/test/std/depr/depr.c.headers/math_h.pass.cpp b/test/std/depr/depr.c.headers/math_h.pass.cpp index ed12fcf73a8cf..7e1b2d110642e 100644 --- a/test/std/depr/depr.c.headers/math_h.pass.cpp +++ b/test/std/depr/depr.c.headers/math_h.pass.cpp @@ -9,9 +9,6 @@ // <math.h> -// NOTE: isinf and isnan are tested separately because they are expected to fail -// on linux. We don't want their expected failure to hide other failures in this file. - #include <math.h> #include <type_traits> #include <cassert> @@ -631,6 +628,29 @@ void test_isgreaterequal() assert(isgreaterequal(-1.0, 0.F) == false); } +void test_isinf() +{ +#ifdef isinf +#error isinf defined +#endif + static_assert((std::is_same<decltype(isinf((float)0)), bool>::value), ""); + + typedef decltype(isinf((double)0)) DoubleRetType; +#ifndef __linux__ + static_assert((std::is_same<DoubleRetType, bool>::value), ""); +#else + // GLIBC < 2.26 defines 'isinf(double)' with a return type of 'int' in + // all C++ dialects. The test should tolerate this. + // See: https://sourceware.org/bugzilla/show_bug.cgi?id=19439 + static_assert((std::is_same<DoubleRetType, bool>::value + || std::is_same<DoubleRetType, int>::value), ""); +#endif + + static_assert((std::is_same<decltype(isinf(0)), bool>::value), ""); + static_assert((std::is_same<decltype(isinf((long double)0)), bool>::value), ""); + assert(isinf(-1.0) == false); +} + void test_isless() { #ifdef isless @@ -688,6 +708,29 @@ void test_islessgreater() assert(islessgreater(-1.0, 0.F) == true); } +void test_isnan() +{ +#ifdef isnan +#error isnan defined +#endif + static_assert((std::is_same<decltype(isnan((float)0)), bool>::value), ""); + + typedef decltype(isnan((double)0)) DoubleRetType; +#ifndef __linux__ + static_assert((std::is_same<DoubleRetType, bool>::value), ""); +#else + // GLIBC < 2.26 defines 'isnan(double)' with a return type of 'int' in + // all C++ dialects. The test should tolerate this. + // See: https://sourceware.org/bugzilla/show_bug.cgi?id=19439 + static_assert((std::is_same<DoubleRetType, bool>::value + || std::is_same<DoubleRetType, int>::value), ""); +#endif + + static_assert((std::is_same<decltype(isnan(0)), bool>::value), ""); + static_assert((std::is_same<decltype(isnan((long double)0)), bool>::value), ""); + assert(isnan(-1.0) == false); +} + void test_isunordered() { #ifdef isunordered @@ -1443,9 +1486,11 @@ int main() test_isnormal(); test_isgreater(); test_isgreaterequal(); + test_isinf(); test_isless(); test_islessequal(); test_islessgreater(); + test_isnan(); test_isunordered(); test_acosh(); test_asinh(); diff --git a/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp b/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp deleted file mode 100644 index cc7eaac7de62b..0000000000000 --- a/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp +++ /dev/null @@ -1,30 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <math.h> - -// isinf - -// XFAIL: linux - -#include <math.h> -#include <type_traits> -#include <cassert> - -int main() -{ -#ifdef isinf -#error isinf defined -#endif - static_assert((std::is_same<decltype(isinf((float)0)), bool>::value), ""); - static_assert((std::is_same<decltype(isinf((double)0)), bool>::value), ""); - static_assert((std::is_same<decltype(isinf(0)), bool>::value), ""); - static_assert((std::is_same<decltype(isinf((long double)0)), bool>::value), ""); - assert(isinf(-1.0) == false); -} diff --git a/test/std/depr/depr.c.headers/math_h_isnan.pass.cpp b/test/std/depr/depr.c.headers/math_h_isnan.pass.cpp deleted file mode 100644 index 118f96bdd4347..0000000000000 --- a/test/std/depr/depr.c.headers/math_h_isnan.pass.cpp +++ /dev/null @@ -1,30 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <math.h> - -// isnan - -// XFAIL: linux - -#include <math.h> -#include <type_traits> -#include <cassert> - -int main() -{ -#ifdef isnan -#error isnan defined -#endif - static_assert((std::is_same<decltype(isnan((float)0)), bool>::value), ""); - static_assert((std::is_same<decltype(isnan((double)0)), bool>::value), ""); - static_assert((std::is_same<decltype(isnan(0)), bool>::value), ""); - static_assert((std::is_same<decltype(isnan((long double)0)), bool>::value), ""); - assert(isnan(-1.0) == false); -} diff --git a/test/std/depr/depr.c.headers/setjmp_h.pass.cpp b/test/std/depr/depr.c.headers/setjmp_h.pass.cpp index 9bc35b747493c..9663d8892ac50 100644 --- a/test/std/depr/depr.c.headers/setjmp_h.pass.cpp +++ b/test/std/depr/depr.c.headers/setjmp_h.pass.cpp @@ -19,6 +19,7 @@ int main() { jmp_buf jb; + ((void)jb); // Prevent unused warning static_assert((std::is_same<decltype(longjmp(jb, 0)), void>::value), "std::is_same<decltype(longjmp(jb, 0)), void>::value"); } diff --git a/test/std/depr/depr.c.headers/stdarg_h.pass.cpp b/test/std/depr/depr.c.headers/stdarg_h.pass.cpp index f7d12b1ad551c..e3c38801e4a87 100644 --- a/test/std/depr/depr.c.headers/stdarg_h.pass.cpp +++ b/test/std/depr/depr.c.headers/stdarg_h.pass.cpp @@ -11,11 +11,13 @@ #include <stdarg.h> +#include "test_macros.h" + #ifndef va_arg #error va_arg not defined #endif -#if __cplusplus >= 201103L +#if TEST_STD_VER >= 11 # ifndef va_copy # error va_copy is not defined when c++ >= 11 # endif diff --git a/test/std/depr/depr.c.headers/stdint_h.pass.cpp b/test/std/depr/depr.c.headers/stdint_h.pass.cpp index 92bb04e558bb5..3d49111fd82b9 100644 --- a/test/std/depr/depr.c.headers/stdint_h.pass.cpp +++ b/test/std/depr/depr.c.headers/stdint_h.pass.cpp @@ -171,8 +171,8 @@ int main() // INTN_MIN static_assert(INT8_MIN == -128, "INT8_MIN == -128"); static_assert(INT16_MIN == -32768, "INT16_MIN == -32768"); - static_assert(INT32_MIN == -2147483648U, "INT32_MIN == -2147483648"); - static_assert(INT64_MIN == -9223372036854775808ULL, "INT64_MIN == -9223372036854775808LL"); + static_assert(INT32_MIN == -2147483647 - 1, "INT32_MIN == -2147483648"); + static_assert(INT64_MIN == -9223372036854775807LL - 1, "INT64_MIN == -9223372036854775808LL"); // INTN_MAX static_assert(INT8_MAX == 127, "INT8_MAX == 127"); @@ -189,8 +189,8 @@ int main() // INT_FASTN_MIN static_assert(INT_FAST8_MIN <= -128, "INT_FAST8_MIN <= -128"); static_assert(INT_FAST16_MIN <= -32768, "INT_FAST16_MIN <= -32768"); - static_assert(INT_FAST32_MIN <= -2147483648U, "INT_FAST32_MIN <= -2147483648"); - static_assert(INT_FAST64_MIN <= -9223372036854775808ULL, "INT_FAST64_MIN <= -9223372036854775808LL"); + static_assert(INT_FAST32_MIN <= -2147483647 - 1, "INT_FAST32_MIN <= -2147483648"); + static_assert(INT_FAST64_MIN <= -9223372036854775807LL - 1, "INT_FAST64_MIN <= -9223372036854775808LL"); // INT_FASTN_MAX static_assert(INT_FAST8_MAX >= 127, "INT_FAST8_MAX >= 127"); diff --git a/test/std/depr/depr.c.headers/stdio_h.pass.cpp b/test/std/depr/depr.c.headers/stdio_h.pass.cpp index 3c5dd0ebf0e0d..85f9d2986284f 100644 --- a/test/std/depr/depr.c.headers/stdio_h.pass.cpp +++ b/test/std/depr/depr.c.headers/stdio_h.pass.cpp @@ -99,17 +99,25 @@ #include <cstdarg> +#if defined(__GNUC__) #pragma GCC diagnostic ignored "-Wformat-zero-length" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" // for tmpnam +#endif int main() { FILE* fp = 0; - fpos_t fpos = {0}; - size_t s = 0; ((void)s); + fpos_t fpos = {}; + size_t s = 0; char* cp = 0; char arr[] = {'a', 'b'}; va_list va; + ((void)fp); // Prevent unused warning + ((void)fpos); // Prevent unused warning + ((void)s); // Prevent unused warning + ((void)cp); // Prevent unused warning + ((void)arr); // Prevent unused warning + ((void)va); // Prevent unused warning static_assert((std::is_same<decltype(remove("")), int>::value), ""); static_assert((std::is_same<decltype(rename("","")), int>::value), ""); static_assert((std::is_same<decltype(tmpfile()), FILE*>::value), ""); diff --git a/test/std/depr/depr.c.headers/string_h.pass.cpp b/test/std/depr/depr.c.headers/string_h.pass.cpp index afc784f74b894..db0308b7ef82c 100644 --- a/test/std/depr/depr.c.headers/string_h.pass.cpp +++ b/test/std/depr/depr.c.headers/string_h.pass.cpp @@ -47,4 +47,15 @@ int main() static_assert((std::is_same<decltype(memset(vp, 0, s)), void*>::value), ""); static_assert((std::is_same<decltype(strerror(0)), char*>::value), ""); static_assert((std::is_same<decltype(strlen(cpc)), size_t>::value), ""); + + // These tests fail on systems whose C library doesn't provide a correct overload + // set for strchr, strpbrk, strrchr, strstr, and memchr, unless the compiler is + // a suitably recent version of Clang. +#if !defined(__APPLE__) || defined(_LIBCPP_PREFERRED_OVERLOAD) + static_assert((std::is_same<decltype(strchr(cpc, 0)), const char*>::value), ""); + static_assert((std::is_same<decltype(strpbrk(cpc, cpc)), const char*>::value), ""); + static_assert((std::is_same<decltype(strrchr(cpc, 0)), const char*>::value), ""); + static_assert((std::is_same<decltype(strstr(cpc, cpc)), const char*>::value), ""); + static_assert((std::is_same<decltype(memchr(vpc, 0, s)), const void*>::value), ""); +#endif } diff --git a/test/std/depr/depr.c.headers/time_h.pass.cpp b/test/std/depr/depr.c.headers/time_h.pass.cpp index 0d229af409bde..a2639383cda7a 100644 --- a/test/std/depr/depr.c.headers/time_h.pass.cpp +++ b/test/std/depr/depr.c.headers/time_h.pass.cpp @@ -25,7 +25,7 @@ int main() clock_t c = 0; ((void)c); size_t s = 0; time_t t = 0; - tm tmv = {0}; + tm tmv = {}; static_assert((std::is_same<decltype(clock()), clock_t>::value), ""); static_assert((std::is_same<decltype(difftime(t,t)), double>::value), ""); static_assert((std::is_same<decltype(mktime(&tmv)), time_t>::value), ""); diff --git a/test/std/depr/depr.c.headers/wchar_h.pass.cpp b/test/std/depr/depr.c.headers/wchar_h.pass.cpp index e561b3e5a724a..f2e42a3285885 100644 --- a/test/std/depr/depr.c.headers/wchar_h.pass.cpp +++ b/test/std/depr/depr.c.headers/wchar_h.pass.cpp @@ -9,8 +9,8 @@ // <wchar.h> - #include <wchar.h> +#include <stdarg.h> #include <type_traits> #ifndef NULL @@ -32,25 +32,25 @@ int main() { // mbstate_t comes from the underlying C library; it is defined (in C99) as: -// a complete object type other than an array type that can hold the conversion -// state information necessary to convert between sequences of multibyte +// a complete object type other than an array type that can hold the conversion +// state information necessary to convert between sequences of multibyte // characters and wide characters -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wmissing-braces" - mbstate_t mb = {0}; -#pragma clang diagnostic pop - + mbstate_t mb = {}; size_t s = 0; tm *tm = 0; wint_t w = 0; ::FILE* fp = 0; -#ifdef __APPLE__ - __darwin_va_list va; -#else - __builtin_va_list va; -#endif + ::va_list va; char* ns = 0; wchar_t* ws = 0; + ((void)mb); // Prevent unused warning + ((void)s); // Prevent unused warning + ((void)tm); // Prevent unused warning + ((void)w); // Prevent unused warning + ((void)fp); // Prevent unused warning + ((void)va); // Prevent unused warning + ((void)ns); // Prevent unused warning + ((void)ws); // Prevent unused warning static_assert((std::is_same<decltype(fwprintf(fp, L"")), int>::value), ""); static_assert((std::is_same<decltype(fwscanf(fp, L"")), int>::value), ""); static_assert((std::is_same<decltype(swprintf(ws, s, L"")), int>::value), ""); @@ -82,19 +82,14 @@ int main() static_assert((std::is_same<decltype(wcscoll(L"", L"")), int>::value), ""); static_assert((std::is_same<decltype(wcsncmp(L"", L"", s)), int>::value), ""); static_assert((std::is_same<decltype(wcsxfrm(ws, L"", s)), size_t>::value), ""); - // const wchar_t* wcschr((const wchar_t*)0, L' ') - See below static_assert((std::is_same<decltype(wcschr((wchar_t*)0, L' ')), wchar_t*>::value), ""); static_assert((std::is_same<decltype(wcscspn(L"", L"")), size_t>::value), ""); static_assert((std::is_same<decltype(wcslen(L"")), size_t>::value), ""); - // const wchar_t* wcspbrk((const wchar_t*)0, L"") - See below static_assert((std::is_same<decltype(wcspbrk((wchar_t*)0, L"")), wchar_t*>::value), ""); - // const wchar_t* wcsrchr((const wchar_t*)0, L' ') - See below static_assert((std::is_same<decltype(wcsrchr((wchar_t*)0, L' ')), wchar_t*>::value), ""); static_assert((std::is_same<decltype(wcsspn(L"", L"")), size_t>::value), ""); - // const wchar_t* wcsstr((const wchar_t*)0, L"") - See below static_assert((std::is_same<decltype(wcsstr((wchar_t*)0, L"")), wchar_t*>::value), ""); static_assert((std::is_same<decltype(wcstok(ws, L"", (wchar_t**)0)), wchar_t*>::value), ""); - // const wchar_t* wmemchr((const wchar_t*)0, L' ', s) - See below static_assert((std::is_same<decltype(wmemchr((wchar_t*)0, L' ', s)), wchar_t*>::value), ""); static_assert((std::is_same<decltype(wmemcmp(L"", L"", s)), int>::value), ""); static_assert((std::is_same<decltype(wmemcpy(ws, L"", s)), wchar_t*>::value), ""); @@ -110,10 +105,10 @@ int main() static_assert((std::is_same<decltype(mbsrtowcs(ws, (const char**)0, s, &mb)), size_t>::value), ""); static_assert((std::is_same<decltype(wcsrtombs(ns, (const wchar_t**)0, s, &mb)), size_t>::value), ""); -// This test fails on systems whose C library doesn't provide a correct overload -// set for wcschr, wcspbrk, wcsrchr, wcsstr, and wmemchr. There's no way for -// libc++ to fix that on the C library's behalf. -#ifndef __APPLE__ + // These tests fail on systems whose C library doesn't provide a correct overload + // set for wcschr, wcspbrk, wcsrchr, wcsstr, and wmemchr, unless the compiler is + // a suitably recent version of Clang. +#if !defined(__APPLE__) || defined(_LIBCPP_PREFERRED_OVERLOAD) static_assert((std::is_same<decltype(wcschr((const wchar_t*)0, L' ')), const wchar_t*>::value), ""); static_assert((std::is_same<decltype(wcspbrk((const wchar_t*)0, L"")), const wchar_t*>::value), ""); static_assert((std::is_same<decltype(wcsrchr((const wchar_t*)0, L' ')), const wchar_t*>::value), ""); diff --git a/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/ccp.pass.cpp b/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/ccp.pass.cpp index 9911df7150780..078d8911d8a68 100644 --- a/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/ccp.pass.cpp +++ b/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/ccp.pass.cpp @@ -15,6 +15,7 @@ #include <strstream> #include <cassert> +#include <string> int main() { diff --git a/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/ccp_size.pass.cpp b/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/ccp_size.pass.cpp index a80095099401b..8b4ae722f2249 100644 --- a/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/ccp_size.pass.cpp +++ b/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/ccp_size.pass.cpp @@ -15,6 +15,7 @@ #include <strstream> #include <cassert> +#include <string> int main() { diff --git a/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/cp.pass.cpp b/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/cp.pass.cpp index edd6c1f6286cd..23068f5fd332a 100644 --- a/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/cp.pass.cpp +++ b/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/cp.pass.cpp @@ -15,6 +15,7 @@ #include <strstream> #include <cassert> +#include <string> int main() { diff --git a/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/cp_size.pass.cpp b/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/cp_size.pass.cpp index 5d01715ba1b70..ff797e0929473 100644 --- a/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/cp_size.pass.cpp +++ b/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/cp_size.pass.cpp @@ -15,6 +15,7 @@ #include <strstream> #include <cassert> +#include <string> int main() { diff --git a/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/cp_size_mode.pass.cpp b/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/cp_size_mode.pass.cpp index 1ad0bfa8e2695..b6519de8eddd3 100644 --- a/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/cp_size_mode.pass.cpp +++ b/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/cp_size_mode.pass.cpp @@ -15,6 +15,7 @@ #include <strstream> #include <cassert> +#include <string> int main() { diff --git a/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/default.pass.cpp b/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/default.pass.cpp index 5ea4988ffa6f5..29debf187c7e2 100644 --- a/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/default.pass.cpp +++ b/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/default.pass.cpp @@ -15,6 +15,7 @@ #include <strstream> #include <cassert> +#include <string> int main() { diff --git a/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/cp_size_mode.pass.cpp b/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/cp_size_mode.pass.cpp index 2a4c0ec5aa201..1dc03b8aa806c 100644 --- a/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/cp_size_mode.pass.cpp +++ b/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/cp_size_mode.pass.cpp @@ -15,6 +15,7 @@ #include <strstream> #include <cassert> +#include <string> int main() { diff --git a/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/default.pass.cpp b/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/default.pass.cpp index 2ec5e7f748e16..6298fcac30a92 100644 --- a/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/default.pass.cpp +++ b/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/default.pass.cpp @@ -15,6 +15,7 @@ #include <strstream> #include <cassert> +#include <string> int main() { diff --git a/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/custom_alloc.pass.cpp b/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/custom_alloc.pass.cpp index 12a1fb874c301..e466d50c64f6d 100644 --- a/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/custom_alloc.pass.cpp +++ b/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/custom_alloc.pass.cpp @@ -18,7 +18,7 @@ int called = 0; -void* my_alloc(std::size_t n) +void* my_alloc(std::size_t) { static char buf[10000]; ++called; diff --git a/test/std/depr/depr.str.strstreams/version.pass.cpp b/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/overflow.pass.cpp index f27665f15bcd7..dda19a9517fb1 100644 --- a/test/std/depr/depr.str.strstreams/version.pass.cpp +++ b/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/overflow.pass.cpp @@ -9,12 +9,24 @@ // <strstream> +// class strstreambuf + +// int overflow(int c); + +#include <iostream> +#include <string> #include <strstream> -#ifndef _LIBCPP_VERSION -#error _LIBCPP_VERSION not defined -#endif +int main() { + std::ostrstream oss; + std::string s; + + for (int i = 0; i < 4096; ++i) + s.push_back((i % 16) + 'a'); + + oss << s << std::ends; + std::cout << oss.str(); + oss.freeze(false); -int main() -{ + return 0; } diff --git a/test/std/depr/exception.unexpected/set.unexpected/get_unexpected.pass.cpp b/test/std/depr/exception.unexpected/set.unexpected/get_unexpected.pass.cpp index 8b0a0b979de0c..02f9a81aa6ddd 100644 --- a/test/std/depr/exception.unexpected/set.unexpected/get_unexpected.pass.cpp +++ b/test/std/depr/exception.unexpected/set.unexpected/get_unexpected.pass.cpp @@ -23,7 +23,7 @@ void f3() int main() { - + std::unexpected_handler old = std::get_unexpected(); // verify there is a previous unexpected handler assert(old); |