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 <class T> 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<int8_t >(); + test<int16_t>(); + test<int32_t>(); + test<int64_t>(); + + test<uint8_t >(); + test<uint16_t>(); + test<uint32_t>(); + test<uint64_t>(); + + test<int_least8_t >(); + test<int_least16_t>(); + test<int_least32_t>(); + test<int_least64_t>(); + + test<uint_least8_t >(); + test<uint_least16_t>(); + test<uint_least32_t>(); + test<uint_least64_t>(); + + test<int_fast8_t >(); + test<int_fast16_t>(); + test<int_fast32_t>(); + test<int_fast64_t>(); + + test<uint_fast8_t >(); + test<uint_fast16_t>(); + test<uint_fast32_t>(); + test<uint_fast64_t>(); + + test<intptr_t >(); + test<uintptr_t>(); + test<intmax_t >(); + test<uintmax_t>(); + { imaxdiv_t i1 = {}; + ((void)i1); // Prevent unused warning } + intmax_t i = 0; + ((void)i); // Prevent unused warning static_assert((std::is_same<decltype(imaxabs(i)), intmax_t>::value), ""); static_assert((std::is_same<decltype(imaxdiv(i, i)), imaxdiv_t>::value), ""); static_assert((std::is_same<decltype(strtoimax("", (char**)0, 0)), intmax_t>::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 <class T> 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<std::int8_t >(); + test<std::int16_t>(); + test<std::int32_t>(); + test<std::int64_t>(); + + test<std::uint8_t >(); + test<std::uint16_t>(); + test<std::uint32_t>(); + test<std::uint64_t>(); + + test<std::int_least8_t >(); + test<std::int_least16_t>(); + test<std::int_least32_t>(); + test<std::int_least64_t>(); + + test<std::uint_least8_t >(); + test<std::uint_least16_t>(); + test<std::uint_least32_t>(); + test<std::uint_least64_t>(); + + test<std::int_fast8_t >(); + test<std::int_fast16_t>(); + test<std::int_fast32_t>(); + test<std::int_fast64_t>(); + + test<std::uint_fast8_t >(); + test<std::uint_fast16_t>(); + test<std::uint_fast32_t>(); + test<std::uint_fast64_t>(); + + test<std::intptr_t >(); + test<std::uintptr_t>(); + test<std::intmax_t >(); + test<std::uintmax_t>(); + { std::imaxdiv_t i1 = {}; + ((void)i1); // Prevent unused warning } + std::intmax_t i = 0; + ((void)i); // Prevent unused warning static_assert((std::is_same<decltype(std::imaxabs(i)), std::intmax_t>::value), ""); static_assert((std::is_same<decltype(std::imaxdiv(i, i)), std::imaxdiv_t>::value), ""); static_assert((std::is_same<decltype(std::strtoimax("", (char**)0, 0)), std::intmax_t>::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<CharT, Traits> 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 <iosfwd> #include <cwchar> // for mbstate_t +template <class Ptr> void test() +{ + Ptr p = 0; + ((void)p); // Prevent unused warning +} + int main() { - { - std::char_traits<char>* t1 = 0; - std::char_traits<wchar_t>* t2 = 0; - std::char_traits<unsigned short>* t3 = 0; - } - { - std::basic_ios<char>* t1 = 0; - std::basic_ios<wchar_t>* t2 = 0; - std::basic_ios<unsigned short>* t3 = 0; - } - { - std::basic_streambuf<char>* t1 = 0; - std::basic_streambuf<wchar_t>* t2 = 0; - std::basic_streambuf<unsigned short>* t3 = 0; - } - { - std::basic_istream<char>* t1 = 0; - std::basic_istream<wchar_t>* t2 = 0; - std::basic_istream<unsigned short>* t3 = 0; - } - { - std::basic_ostream<char>* t1 = 0; - std::basic_ostream<wchar_t>* t2 = 0; - std::basic_ostream<unsigned short>* t3 = 0; - } - { - std::basic_iostream<char>* t1 = 0; - std::basic_iostream<wchar_t>* t2 = 0; - std::basic_iostream<unsigned short>* t3 = 0; - } - { - std::basic_stringbuf<char>* t1 = 0; - std::basic_stringbuf<wchar_t>* t2 = 0; - std::basic_stringbuf<unsigned short>* t3 = 0; - } - { - std::basic_istringstream<char>* t1 = 0; - std::basic_istringstream<wchar_t>* t2 = 0; - std::basic_istringstream<unsigned short>* t3 = 0; - } - { - std::basic_ostringstream<char>* t1 = 0; - std::basic_ostringstream<wchar_t>* t2 = 0; - std::basic_ostringstream<unsigned short>* t3 = 0; - } - { - std::basic_stringstream<char>* t1 = 0; - std::basic_stringstream<wchar_t>* t2 = 0; - std::basic_stringstream<unsigned short>* t3 = 0; - } - { - std::basic_filebuf<char>* t1 = 0; - std::basic_filebuf<wchar_t>* t2 = 0; - std::basic_filebuf<unsigned short>* t3 = 0; - } - { - std::basic_ifstream<char>* t1 = 0; - std::basic_ifstream<wchar_t>* t2 = 0; - std::basic_ifstream<unsigned short>* t3 = 0; - } - { - std::basic_ofstream<char>* t1 = 0; - std::basic_ofstream<wchar_t>* t2 = 0; - std::basic_ofstream<unsigned short>* t3 = 0; - } - { - std::basic_fstream<char>* t1 = 0; - std::basic_fstream<wchar_t>* t2 = 0; - std::basic_fstream<unsigned short>* t3 = 0; - } - { - std::istreambuf_iterator<char>* t1 = 0; - std::istreambuf_iterator<wchar_t>* t2 = 0; - std::istreambuf_iterator<unsigned short>* t3 = 0; - } - { - std::ostreambuf_iterator<char>* t1 = 0; - std::ostreambuf_iterator<wchar_t>* t2 = 0; - std::ostreambuf_iterator<unsigned short>* 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<std::mbstate_t>* t1 = 0; - std::streampos* t2 = 0; - std::wstreampos* t3 = 0; - } + test<std::char_traits<char>* >(); + test<std::char_traits<wchar_t>* >(); + test<std::char_traits<unsigned short>*>(); + + test<std::basic_ios<char>* >(); + test<std::basic_ios<wchar_t>* >(); + test<std::basic_ios<unsigned short>*>(); + + test<std::basic_streambuf<char>* >(); + test<std::basic_streambuf<wchar_t>* >(); + test<std::basic_streambuf<unsigned short>*>(); + + test<std::basic_istream<char>* >(); + test<std::basic_istream<wchar_t>* >(); + test<std::basic_istream<unsigned short>*>(); + + test<std::basic_ostream<char>* >(); + test<std::basic_ostream<wchar_t>* >(); + test<std::basic_ostream<unsigned short>*>(); + + test<std::basic_iostream<char>* >(); + test<std::basic_iostream<wchar_t>* >(); + test<std::basic_iostream<unsigned short>*>(); + + test<std::basic_stringbuf<char>* >(); + test<std::basic_stringbuf<wchar_t>* >(); + test<std::basic_stringbuf<unsigned short>*>(); + + test<std::basic_istringstream<char>* >(); + test<std::basic_istringstream<wchar_t>* >(); + test<std::basic_istringstream<unsigned short>*>(); + + test<std::basic_ostringstream<char>* >(); + test<std::basic_ostringstream<wchar_t>* >(); + test<std::basic_ostringstream<unsigned short>*>(); + + test<std::basic_stringstream<char>* >(); + test<std::basic_stringstream<wchar_t>* >(); + test<std::basic_stringstream<unsigned short>*>(); + + test<std::basic_filebuf<char>* >(); + test<std::basic_filebuf<wchar_t>* >(); + test<std::basic_filebuf<unsigned short>*>(); + + test<std::basic_ifstream<char>* >(); + test<std::basic_ifstream<wchar_t>* >(); + test<std::basic_ifstream<unsigned short>*>(); + + test<std::basic_ofstream<char>* >(); + test<std::basic_ofstream<wchar_t>* >(); + test<std::basic_ofstream<unsigned short>*>(); + + test<std::basic_fstream<char>* >(); + test<std::basic_fstream<wchar_t>* >(); + test<std::basic_fstream<unsigned short>*>(); + + test<std::istreambuf_iterator<char>* >(); + test<std::istreambuf_iterator<wchar_t>* >(); + test<std::istreambuf_iterator<unsigned short>*>(); + + test<std::ostreambuf_iterator<char>* >(); + test<std::ostreambuf_iterator<wchar_t>* >(); + test<std::ostreambuf_iterator<unsigned short>*>(); + + test<std::ios* >(); + test<std::wios*>(); + + test<std::streambuf*>(); + test<std::istream* >(); + test<std::ostream* >(); + test<std::iostream* >(); + + test<std::stringbuf* >(); + test<std::istringstream*>(); + test<std::ostringstream*>(); + test<std::stringstream* >(); + + test<std::filebuf* >(); + test<std::ifstream*>(); + test<std::ofstream*>(); + test<std::fstream* >(); + + test<std::wstreambuf*>(); + test<std::wistream* >(); + test<std::wostream* >(); + test<std::wiostream* >(); + + test<std::wstringbuf* >(); + test<std::wistringstream*>(); + test<std::wostringstream*>(); + test<std::wstringstream* >(); + + test<std::wfilebuf* >(); + test<std::wifstream*>(); + test<std::wofstream*>(); + test<std::wfstream* >(); + + test<std::fpos<std::mbstate_t>*>(); + test<std::streampos* >(); + test<std::wstreampos* >(); } 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<std::collate<char> >(l)); const std::collate<char>& f = std::use_facet<std::collate<char> >(l); + ((void)f); // Prevent unused warning { (void)std::collate<char>::id; } @@ -39,6 +40,7 @@ { assert(std::has_facet<std::collate<wchar_t> >(l)); const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l); + ((void)f); // Prevent unused warning { (void)std::collate<wchar_t>::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<std::ctype<char> >(l)); const std::ctype<char>& f = std::use_facet<std::ctype<char> >(l); + ((void)f); // Prevent unused warning { (void)std::ctype<char>::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<F>(l)); const F& f = std::use_facet<F>(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<F>(l)); const F& f = std::use_facet<F>(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<std::ctype<wchar_t> >(l)); const std::ctype<wchar_t>& f = std::use_facet<std::ctype<wchar_t> >(l); + ((void)f); // Prevent unused warning { (void)std::ctype<wchar_t>::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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<char*> iter = f.put(output_iterator<char*>(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<std::numpunct<char> >(l)); const std::numpunct<char>& f = std::use_facet<std::numpunct<char> >(l); + ((void)f); // Prevent unused warning { (void)std::numpunct<char>::id; } @@ -38,6 +39,7 @@ { assert(std::has_facet<std::numpunct<wchar_t> >(l)); const std::numpunct<wchar_t>& f = std::use_facet<std::numpunct<wchar_t> >(l); + ((void)f); // Prevent unused warning { (void)std::numpunct<wchar_t>::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<my_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<double> 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<char>::eq('a', 'a')); assert(!std::char_traits<char>::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<char16_t>::int_type i = std::char_traits<char16_t>::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<char16_t>::eq(u'a', u'a')); assert(!std::char_traits<char16_t>::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<char16_t>::lt(u'a', u'a')); assert( std::char_traits<char16_t>::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<char32_t>::int_type i = std::char_traits<char32_t>::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<char32_t>::eq(U'a', U'a')); assert(!std::char_traits<char32_t>::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<char32_t>::lt(U'a', U'a')); assert( std::char_traits<char32_t>::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<wchar_t>::eq(L'a', L'a')); assert(!std::char_traits<wchar_t>::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<wchar_t>::lt(L'a', L'a')); assert( std::char_traits<wchar_t>::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) {