Index: test/std/depr/depr.c.headers/inttypes_h.pass.cpp =================================================================== --- test/std/depr/depr.c.headers/inttypes_h.pass.cpp +++ test/std/depr/depr.c.headers/inttypes_h.pass.cpp @@ -872,54 +872,56 @@ #error SCNxPTR not defined #endif +template void test() +{ + T t = 0; + ((void)t); // Prevent unused warning +} + int main() { - { - int8_t i1 = 0; - int16_t i2 = 0; - int32_t i3 = 0; - int64_t i4 = 0; - } - { - uint8_t i1 = 0; - uint16_t i2 = 0; - uint32_t i3 = 0; - uint64_t i4 = 0; - } - { - int_least8_t i1 = 0; - int_least16_t i2 = 0; - int_least32_t i3 = 0; - int_least64_t i4 = 0; - } - { - uint_least8_t i1 = 0; - uint_least16_t i2 = 0; - uint_least32_t i3 = 0; - uint_least64_t i4 = 0; - } - { - int_fast8_t i1 = 0; - int_fast16_t i2 = 0; - int_fast32_t i3 = 0; - int_fast64_t i4 = 0; - } - { - uint_fast8_t i1 = 0; - uint_fast16_t i2 = 0; - uint_fast32_t i3 = 0; - uint_fast64_t i4 = 0; - } - { - intptr_t i1 = 0; - uintptr_t i2 = 0; - intmax_t i3 = 0; - uintmax_t i4 = 0; - } + test(); + test(); + test(); + test(); + + test(); + test(); + test(); + test(); + + test(); + test(); + test(); + test(); + + test(); + test(); + test(); + test(); + + test(); + test(); + test(); + test(); + + test(); + test(); + test(); + test(); + + test(); + test(); + test(); + test(); + { imaxdiv_t i1 = {}; + ((void)i1); // Prevent unused warning } + intmax_t i = 0; + ((void)i); // Prevent unused warning static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); Index: test/std/input.output/file.streams/c.files/cinttypes.pass.cpp =================================================================== --- test/std/input.output/file.streams/c.files/cinttypes.pass.cpp +++ test/std/input.output/file.streams/c.files/cinttypes.pass.cpp @@ -872,54 +872,56 @@ #error SCNxPTR not defined #endif +template void test() +{ + T t = 0; + ((void)t); // Prevent unused warning +} + int main() { - { - std::int8_t i1 = 0; - std::int16_t i2 = 0; - std::int32_t i3 = 0; - std::int64_t i4 = 0; - } - { - std::uint8_t i1 = 0; - std::uint16_t i2 = 0; - std::uint32_t i3 = 0; - std::uint64_t i4 = 0; - } - { - std::int_least8_t i1 = 0; - std::int_least16_t i2 = 0; - std::int_least32_t i3 = 0; - std::int_least64_t i4 = 0; - } - { - std::uint_least8_t i1 = 0; - std::uint_least16_t i2 = 0; - std::uint_least32_t i3 = 0; - std::uint_least64_t i4 = 0; - } - { - std::int_fast8_t i1 = 0; - std::int_fast16_t i2 = 0; - std::int_fast32_t i3 = 0; - std::int_fast64_t i4 = 0; - } - { - std::uint_fast8_t i1 = 0; - std::uint_fast16_t i2 = 0; - std::uint_fast32_t i3 = 0; - std::uint_fast64_t i4 = 0; - } - { - std::intptr_t i1 = 0; - std::uintptr_t i2 = 0; - std::intmax_t i3 = 0; - std::uintmax_t i4 = 0; - } + test(); + test(); + test(); + test(); + + test(); + test(); + test(); + test(); + + test(); + test(); + test(); + test(); + + test(); + test(); + test(); + test(); + + test(); + test(); + test(); + test(); + + test(); + test(); + test(); + test(); + + test(); + test(); + test(); + test(); + { std::imaxdiv_t i1 = {}; + ((void)i1); // Prevent unused warning } + std::intmax_t i = 0; + ((void)i); // Prevent unused warning static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); Index: test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp =================================================================== --- test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp +++ test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp @@ -32,6 +32,7 @@ std::basic_stringstream ss; bool skippingws = is_skipws ( ss ); + ((void)skippingws); // Prevent unused warning ss << q; ss >> q; } Index: test/std/input.output/iostream.forward/iosfwd.pass.cpp =================================================================== --- test/std/input.output/iostream.forward/iosfwd.pass.cpp +++ test/std/input.output/iostream.forward/iosfwd.pass.cpp @@ -12,131 +12,112 @@ #include #include // for mbstate_t +template void test() +{ + Ptr p = 0; + ((void)p); // Prevent unused warning +} + int main() { - { - std::char_traits* t1 = 0; - std::char_traits* t2 = 0; - std::char_traits* t3 = 0; - } - { - std::basic_ios* t1 = 0; - std::basic_ios* t2 = 0; - std::basic_ios* t3 = 0; - } - { - std::basic_streambuf* t1 = 0; - std::basic_streambuf* t2 = 0; - std::basic_streambuf* t3 = 0; - } - { - std::basic_istream* t1 = 0; - std::basic_istream* t2 = 0; - std::basic_istream* t3 = 0; - } - { - std::basic_ostream* t1 = 0; - std::basic_ostream* t2 = 0; - std::basic_ostream* t3 = 0; - } - { - std::basic_iostream* t1 = 0; - std::basic_iostream* t2 = 0; - std::basic_iostream* t3 = 0; - } - { - std::basic_stringbuf* t1 = 0; - std::basic_stringbuf* t2 = 0; - std::basic_stringbuf* t3 = 0; - } - { - std::basic_istringstream* t1 = 0; - std::basic_istringstream* t2 = 0; - std::basic_istringstream* t3 = 0; - } - { - std::basic_ostringstream* t1 = 0; - std::basic_ostringstream* t2 = 0; - std::basic_ostringstream* t3 = 0; - } - { - std::basic_stringstream* t1 = 0; - std::basic_stringstream* t2 = 0; - std::basic_stringstream* t3 = 0; - } - { - std::basic_filebuf* t1 = 0; - std::basic_filebuf* t2 = 0; - std::basic_filebuf* t3 = 0; - } - { - std::basic_ifstream* t1 = 0; - std::basic_ifstream* t2 = 0; - std::basic_ifstream* t3 = 0; - } - { - std::basic_ofstream* t1 = 0; - std::basic_ofstream* t2 = 0; - std::basic_ofstream* t3 = 0; - } - { - std::basic_fstream* t1 = 0; - std::basic_fstream* t2 = 0; - std::basic_fstream* t3 = 0; - } - { - std::istreambuf_iterator* t1 = 0; - std::istreambuf_iterator* t2 = 0; - std::istreambuf_iterator* t3 = 0; - } - { - std::ostreambuf_iterator* t1 = 0; - std::ostreambuf_iterator* t2 = 0; - std::ostreambuf_iterator* t3 = 0; - } - { - std::ios* t1 = 0; - std::wios* t2 = 0; - } - { - std::streambuf* t1 = 0; - std::istream* t2 = 0; - std::ostream* t3 = 0; - std::iostream* t4 = 0; - } - { - std::stringbuf* t1 = 0; - std::istringstream* t2 = 0; - std::ostringstream* t3 = 0; - std::stringstream* t4 = 0; - } - { - std::filebuf* t1 = 0; - std::ifstream* t2 = 0; - std::ofstream* t3 = 0; - std::fstream* t4 = 0; - } - { - std::wstreambuf* t1 = 0; - std::wistream* t2 = 0; - std::wostream* t3 = 0; - std::wiostream* t4 = 0; - } - { - std::wstringbuf* t1 = 0; - std::wistringstream* t2 = 0; - std::wostringstream* t3 = 0; - std::wstringstream* t4 = 0; - } - { - std::wfilebuf* t1 = 0; - std::wifstream* t2 = 0; - std::wofstream* t3 = 0; - std::wfstream* t4 = 0; - } - { - std::fpos* t1 = 0; - std::streampos* t2 = 0; - std::wstreampos* t3 = 0; - } + test* >(); + test* >(); + test*>(); + + test* >(); + test* >(); + test*>(); + + test* >(); + test* >(); + test*>(); + + test* >(); + test* >(); + test*>(); + + test* >(); + test* >(); + test*>(); + + test* >(); + test* >(); + test*>(); + + test* >(); + test* >(); + test*>(); + + test* >(); + test* >(); + test*>(); + + test* >(); + test* >(); + test*>(); + + test* >(); + test* >(); + test*>(); + + test* >(); + test* >(); + test*>(); + + test* >(); + test* >(); + test*>(); + + test* >(); + test* >(); + test*>(); + + test* >(); + test* >(); + test*>(); + + test* >(); + test* >(); + test*>(); + + test* >(); + test* >(); + test*>(); + + test(); + test(); + + test(); + test(); + test(); + test(); + + test(); + test(); + test(); + test(); + + test(); + test(); + test(); + test(); + + test(); + test(); + test(); + test(); + + test(); + test(); + test(); + test(); + + test(); + test(); + test(); + test(); + + test*>(); + test(); + test(); } Index: test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp =================================================================== --- test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp +++ test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp @@ -29,6 +29,7 @@ { assert(std::has_facet >(l)); const std::collate& f = std::use_facet >(l); + ((void)f); // Prevent unused warning { (void)std::collate::id; } @@ -39,6 +40,7 @@ { assert(std::has_facet >(l)); const std::collate& f = std::use_facet >(l); + ((void)f); // Prevent unused warning { (void)std::collate::id; } Index: test/std/localization/locale.categories/category.ctype/facet.ctype.special/types.pass.cpp =================================================================== --- test/std/localization/locale.categories/category.ctype/facet.ctype.special/types.pass.cpp +++ test/std/localization/locale.categories/category.ctype/facet.ctype.special/types.pass.cpp @@ -28,6 +28,7 @@ { assert(std::has_facet >(l)); const std::ctype& f = std::use_facet >(l); + ((void)f); // Prevent unused warning { (void)std::ctype::id; } Index: test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char.pass.cpp =================================================================== --- test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char.pass.cpp +++ test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char.pass.cpp @@ -36,5 +36,6 @@ std::locale l = std::locale::classic(); assert(std::has_facet(l)); const F& f = std::use_facet(l); + ((void)f); // Prevent unused warning (void)F::id; } Index: test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp =================================================================== --- test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp +++ test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp @@ -36,5 +36,6 @@ std::locale l = std::locale::classic(); assert(std::has_facet(l)); const F& f = std::use_facet(l); + ((void)f); // Prevent unused warning (void)F::id; } Index: test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp =================================================================== --- test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp +++ test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp @@ -28,6 +28,7 @@ { assert(std::has_facet >(l)); const std::ctype& f = std::use_facet >(l); + ((void)f); // Prevent unused warning { (void)std::ctype::id; } Index: test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long.pass.cpp =================================================================== --- test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long.pass.cpp +++ test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long.pass.cpp @@ -47,7 +47,6 @@ std::ios ios(0); long v = 0; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "0"); @@ -56,7 +55,6 @@ std::ios ios(0); long v = 1; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "1"); @@ -65,7 +63,6 @@ std::ios ios(0); long v = -1; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "-1"); @@ -74,7 +71,6 @@ std::ios ios(0); long v = -1000; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "-1000"); @@ -83,7 +79,6 @@ std::ios ios(0); long v = 1000; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "1000"); @@ -93,7 +88,6 @@ showpos(ios); long v = 1000; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "+1000"); @@ -103,7 +97,6 @@ oct(ios); long v = 1000; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "1750"); @@ -114,7 +107,6 @@ showbase(ios); long v = 1000; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "01750"); @@ -124,7 +116,6 @@ hex(ios); long v = 1000; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "3e8"); @@ -135,7 +126,6 @@ showbase(ios); long v = 1000; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "0x3e8"); @@ -147,7 +137,6 @@ uppercase(ios); long v = 1000; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "0X3E8"); @@ -160,7 +149,6 @@ uppercase(ios); long v = 1000; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "0X3E_8"); @@ -172,7 +160,6 @@ showbase(ios); long v = 2147483647; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "0x7f_fff_ff_f"); @@ -183,7 +170,6 @@ oct(ios); long v = 0123467; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "123_46_7"); @@ -195,7 +181,6 @@ showbase(ios); long v = 0123467; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "0_123_46_7"); @@ -209,7 +194,6 @@ ios.width(15); long v = 0123467; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "*****0_123_46_7"); @@ -223,7 +207,6 @@ ios.width(15); long v = 0123467; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "0_123_46_7*****"); @@ -237,7 +220,6 @@ ios.width(15); long v = 0123467; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "*****0_123_46_7"); @@ -252,7 +234,6 @@ ios.width(15); long v = 2147483647; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "**0x7f_fff_ff_f"); @@ -266,7 +247,6 @@ ios.width(15); long v = 2147483647; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "0x7f_fff_ff_f**"); @@ -280,7 +260,6 @@ ios.width(15); long v = 2147483647; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "0x**7f_fff_ff_f"); @@ -294,7 +273,6 @@ right(ios); ios.width(10); char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "***+1_00_0"); @@ -308,7 +286,6 @@ left(ios); ios.width(10); char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "+1_00_0***"); @@ -322,7 +299,6 @@ internal(ios); ios.width(10); char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "+***1_00_0"); @@ -336,7 +312,6 @@ showpos(ios); ios.width(10); char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "***-1_00_0"); @@ -349,7 +324,6 @@ left(ios); ios.width(10); char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "-1_00_0***"); @@ -362,7 +336,6 @@ internal(ios); ios.width(10); char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "-***1_00_0"); Index: test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp =================================================================== --- test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp +++ test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp @@ -47,7 +47,6 @@ std::ios ios(0); unsigned long v = 0; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "0"); @@ -56,7 +55,6 @@ std::ios ios(0); unsigned long v = 1; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "1"); @@ -65,7 +63,6 @@ std::ios ios(0); unsigned long v = -1; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == (sizeof(unsigned long) == 4 ? "4294967295" : "18446744073709551615")); @@ -74,7 +71,6 @@ std::ios ios(0); unsigned long v = -1000; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == (sizeof(unsigned long) == 4 ? "4294966296" : "18446744073709550616")); @@ -83,7 +79,6 @@ std::ios ios(0); unsigned long v = 1000; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "1000"); @@ -93,7 +88,6 @@ showpos(ios); unsigned long v = 1000; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "1000"); @@ -103,7 +97,6 @@ oct(ios); unsigned long v = 1000; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "1750"); @@ -114,7 +107,6 @@ showbase(ios); unsigned long v = 1000; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "01750"); @@ -124,7 +116,6 @@ hex(ios); unsigned long v = 1000; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "3e8"); @@ -135,7 +126,6 @@ showbase(ios); unsigned long v = 1000; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "0x3e8"); @@ -147,7 +137,6 @@ uppercase(ios); unsigned long v = 1000; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "0X3E8"); @@ -160,7 +149,6 @@ uppercase(ios); unsigned long v = 1000; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "0X3E_8"); @@ -172,7 +160,6 @@ showbase(ios); unsigned long v = 2147483647; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "0x7f_fff_ff_f"); @@ -183,7 +170,6 @@ oct(ios); unsigned long v = 0123467; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "123_46_7"); @@ -195,7 +181,6 @@ showbase(ios); unsigned long v = 0123467; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "0_123_46_7"); @@ -209,7 +194,6 @@ ios.width(15); unsigned long v = 0123467; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "*****0_123_46_7"); @@ -223,7 +207,6 @@ ios.width(15); unsigned long v = 0123467; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "0_123_46_7*****"); @@ -237,7 +220,6 @@ ios.width(15); unsigned long v = 0123467; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "*****0_123_46_7"); @@ -252,7 +234,6 @@ ios.width(15); unsigned long v = 2147483647; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "**0x7f_fff_ff_f"); @@ -266,7 +247,6 @@ ios.width(15); unsigned long v = 2147483647; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "0x7f_fff_ff_f**"); @@ -280,7 +260,6 @@ ios.width(15); unsigned long v = 2147483647; char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "0x**7f_fff_ff_f"); @@ -294,7 +273,6 @@ right(ios); ios.width(10); char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "****1_00_0"); @@ -308,7 +286,6 @@ left(ios); ios.width(10); char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "1_00_0****"); @@ -322,7 +299,6 @@ internal(ios); ios.width(10); char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == "****1_00_0"); @@ -336,7 +312,6 @@ showpos(ios); ios.width(10); char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == (sizeof(unsigned long) == 4 ? "4_294_966_29_6" @@ -350,7 +325,6 @@ left(ios); ios.width(10); char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == (sizeof(unsigned long) == 4 ? "4_294_966_29_6" @@ -364,7 +338,6 @@ internal(ios); ios.width(10); char str[50]; - std::ios_base::iostate err = ios.goodbit; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); assert(ex == (sizeof(unsigned long) == 4 ? "4_294_966_29_6" Index: test/std/localization/locale.categories/category.time/locale.time.get/time_base.pass.cpp =================================================================== --- test/std/localization/locale.categories/category.time/locale.time.get/time_base.pass.cpp +++ test/std/localization/locale.categories/category.time/locale.time.get/time_base.pass.cpp @@ -21,6 +21,7 @@ int main() { std::time_base::dateorder d = std::time_base::no_order; + ((void)d); // Prevent unused warning assert(std::time_base::no_order == 0); assert(std::time_base::dmy == 1); assert(std::time_base::mdy == 2); Index: test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp =================================================================== --- test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp +++ test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp @@ -28,6 +28,7 @@ { assert(std::has_facet >(l)); const std::numpunct& f = std::use_facet >(l); + ((void)f); // Prevent unused warning { (void)std::numpunct::id; } @@ -38,6 +39,7 @@ { assert(std::has_facet >(l)); const std::numpunct& f = std::use_facet >(l); + ((void)f); // Prevent unused warning { (void)std::numpunct::id; } Index: test/std/localization/locales/locale.global.templates/use_facet.pass.cpp =================================================================== --- test/std/localization/locales/locale.global.templates/use_facet.pass.cpp +++ test/std/localization/locales/locale.global.templates/use_facet.pass.cpp @@ -35,6 +35,7 @@ try { const my_facet& f = std::use_facet(std::locale()); + ((void)f); // Prevent unused warning assert(false); } catch (std::bad_cast&) Index: test/std/numerics/c.math/ctgmath.pass.cpp =================================================================== --- test/std/numerics/c.math/ctgmath.pass.cpp +++ test/std/numerics/c.math/ctgmath.pass.cpp @@ -15,4 +15,5 @@ { std::complex cd; double x = std::sin(0); + ((void)x); // Prevent unused warning } Index: test/std/numerics/rand/rand.device/entropy.pass.cpp =================================================================== --- test/std/numerics/rand/rand.device/entropy.pass.cpp +++ test/std/numerics/rand/rand.device/entropy.pass.cpp @@ -20,4 +20,5 @@ { std::random_device r; double e = r.entropy(); + ((void)e); // Prevent unused warning } Index: test/std/numerics/rand/rand.device/eval.pass.cpp =================================================================== --- test/std/numerics/rand/rand.device/eval.pass.cpp +++ test/std/numerics/rand/rand.device/eval.pass.cpp @@ -23,6 +23,7 @@ { std::random_device r; std::random_device::result_type e = r(); + ((void)e); // Prevent unused warning } #ifndef TEST_HAS_NO_EXCEPTIONS Index: test/std/strings/basic.string/string.capacity/reserve.pass.cpp =================================================================== --- test/std/strings/basic.string/string.capacity/reserve.pass.cpp +++ test/std/strings/basic.string/string.capacity/reserve.pass.cpp @@ -36,6 +36,7 @@ test(S s, typename S::size_type res_arg) { typename S::size_type old_cap = s.capacity(); + ((void)old_cap); // Prevent unused warning S s0 = s; if (res_arg <= s.max_size()) { Index: test/std/strings/basic.string/string.modifiers/string_copy/copy.pass.cpp =================================================================== --- test/std/strings/basic.string/string.modifiers/string_copy/copy.pass.cpp +++ test/std/strings/basic.string/string.modifiers/string_copy/copy.pass.cpp @@ -39,6 +39,7 @@ try { typename S::size_type r = cs.copy(s, n, pos); + ((void)r); // Prevent unused warning assert(false); } catch (std::out_of_range&) Index: test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/eq.pass.cpp =================================================================== --- test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/eq.pass.cpp +++ test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/eq.pass.cpp @@ -18,7 +18,6 @@ int main() { - char c = '\0'; assert(std::char_traits::eq('a', 'a')); assert(!std::char_traits::eq('a', 'A')); } Index: test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eof.pass.cpp =================================================================== --- test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eof.pass.cpp +++ test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eof.pass.cpp @@ -20,5 +20,6 @@ { #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS std::char_traits::int_type i = std::char_traits::eof(); + ((void)i); // Prevent unused warning #endif } Index: test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eq.pass.cpp =================================================================== --- test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eq.pass.cpp +++ test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eq.pass.cpp @@ -22,7 +22,6 @@ { #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #if TEST_STD_VER >= 11 - char16_t c = u'\0'; assert(std::char_traits::eq(u'a', u'a')); assert(!std::char_traits::eq(u'a', u'A')); #endif Index: test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/lt.pass.cpp =================================================================== --- test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/lt.pass.cpp +++ test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/lt.pass.cpp @@ -22,7 +22,6 @@ { #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #if TEST_STD_VER >= 11 - char16_t c = u'\0'; assert(!std::char_traits::lt(u'a', u'a')); assert( std::char_traits::lt(u'A', u'a')); #endif Index: test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eof.pass.cpp =================================================================== --- test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eof.pass.cpp +++ test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eof.pass.cpp @@ -20,5 +20,6 @@ { #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS std::char_traits::int_type i = std::char_traits::eof(); + ((void)i); // Prevent unused warning #endif } Index: test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eq.pass.cpp =================================================================== --- test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eq.pass.cpp +++ test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eq.pass.cpp @@ -22,7 +22,6 @@ { #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #if TEST_STD_VER >= 11 - char32_t c = U'\0'; assert(std::char_traits::eq(U'a', U'a')); assert(!std::char_traits::eq(U'a', U'A')); #endif Index: test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/lt.pass.cpp =================================================================== --- test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/lt.pass.cpp +++ test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/lt.pass.cpp @@ -22,7 +22,6 @@ { #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #if TEST_STD_VER >= 11 - char32_t c = U'\0'; assert(!std::char_traits::lt(U'a', U'a')); assert( std::char_traits::lt(U'A', U'a')); #endif Index: test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp =================================================================== --- test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp +++ test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp @@ -18,7 +18,6 @@ int main() { - wchar_t c = L'\0'; assert(std::char_traits::eq(L'a', L'a')); assert(!std::char_traits::eq(L'a', L'A')); } Index: test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp =================================================================== --- test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp +++ test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp @@ -18,7 +18,6 @@ int main() { - wchar_t c = L'\0'; assert(!std::char_traits::lt(L'a', L'a')); assert( std::char_traits::lt(L'A', L'a')); } Index: test/std/thread/futures/futures.promise/dtor.pass.cpp =================================================================== --- test/std/thread/futures/futures.promise/dtor.pass.cpp +++ test/std/thread/futures/futures.promise/dtor.pass.cpp @@ -44,6 +44,7 @@ try { T i = f.get(); + ((void)i); // Prevent unused warning assert(false); } catch (const std::future_error& e) @@ -75,6 +76,7 @@ try { T i = f.get(); + ((void)i); // Prevent unused warning assert(false); } catch (const std::future_error& e) Index: test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp =================================================================== --- test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp +++ test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp @@ -50,6 +50,7 @@ try { double i = f.get(); + ((void)i); // Prevent unused warning assert(false); } catch (const std::future_error& e) Index: test/std/thread/thread.condition/thread.condition.condvar/wait_for_pred.pass.cpp =================================================================== --- test/std/thread/thread.condition/thread.condition.condvar/wait_for_pred.pass.cpp +++ test/std/thread/thread.condition/thread.condition.condvar/wait_for_pred.pass.cpp @@ -52,6 +52,7 @@ cv.notify_one(); Clock::time_point t0 = Clock::now(); bool r = cv.wait_for(lk, milliseconds(250), Pred(test2)); + ((void)r); // Prevent unused warning Clock::time_point t1 = Clock::now(); if (runs == 0) {