diff options
author | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-11-14 17:35:14 +0000 |
---|---|---|
committer | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-11-14 17:35:14 +0000 |
commit | 4dc0ed83905af9b48c94b640757c260781d60fd0 (patch) | |
tree | b3c5bab49e9ce682c96bc462a5b463bf29180aec /libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp | |
parent | 39f5e864e6b02cdeb20c4a12229e19e266bdd7be (diff) | |
download | bcm5719-llvm-4dc0ed83905af9b48c94b640757c260781d60fd0.tar.gz bcm5719-llvm-4dc0ed83905af9b48c94b640757c260781d60fd0.zip |
[libcxx] [test] D26314: Fix MSVC warning C4189 "local variable is initialized but not referenced".
test/std/depr/depr.c.headers/inttypes_h.pass.cpp
test/std/input.output/file.streams/c.files/cinttypes.pass.cpp
test/std/input.output/iostream.forward/iosfwd.pass.cpp
Add test() to avoid a bunch of void-casts, although we still need a few.
test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp
skippingws was unused (it's unclear to me whether this was mistakenly copy-pasted from round_trip() below).
test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp
test/std/localization/locale.categories/category.ctype/facet.ctype.special/types.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_wchar_t.pass.cpp
test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp
test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp
test/std/localization/locales/locale.global.templates/use_facet.pass.cpp
When retrieving facets, the references are unused.
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_unsigned_long.pass.cpp
"std::ios_base::iostate err = ios.goodbit;" was completely unused here.
test/std/localization/locale.categories/category.time/locale.time.get/time_base.pass.cpp
test/std/numerics/c.math/ctgmath.pass.cpp
test/std/numerics/rand/rand.device/entropy.pass.cpp
test/std/numerics/rand/rand.device/eval.pass.cpp
test/std/strings/basic.string/string.modifiers/string_copy/copy.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.char32_t/eof.pass.cpp
test/std/thread/futures/futures.promise/dtor.pass.cpp
test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp
test/std/thread/thread.condition/thread.condition.condvar/wait_for_pred.pass.cpp
These variables are verifying types but are otherwise unused.
test/std/strings/basic.string/string.capacity/reserve.pass.cpp
old_cap was unused (it's unclear to me whether it was intended to be used).
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.char16_t/eq.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.char32_t/eq.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.wchar.t/eq.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp
These tests contained unused characters.
llvm-svn: 286847
Diffstat (limited to 'libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp')
-rw-r--r-- | libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp | 231 |
1 files changed, 106 insertions, 125 deletions
diff --git a/libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp b/libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp index 7250c2adb27..53d12ecfc77 100644 --- a/libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp +++ b/libcxx/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* >(); } |