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/depr | |
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/depr')
-rw-r--r-- | libcxx/test/std/depr/depr.c.headers/inttypes_h.pass.cpp | 86 |
1 files changed, 44 insertions, 42 deletions
diff --git a/libcxx/test/std/depr/depr.c.headers/inttypes_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/inttypes_h.pass.cpp index ff045a913fd..5b0bb3bff37 100644 --- a/libcxx/test/std/depr/depr.c.headers/inttypes_h.pass.cpp +++ b/libcxx/test/std/depr/depr.c.headers/inttypes_h.pass.cpp @@ -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), ""); |