[PATCH] D54508: [libcxx] [test] Fix Clang -Wunused-local-typedef, MSVC C4800, missing cassert.

Stephan T. Lavavej via Phabricator reviews at reviews.llvm.org
Tue Nov 13 19:35:19 PST 2018


STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.

[libcxx] [test] Fix Clang -Wunused-local-typedef, MSVC C4800, missing cassert.

test/std/containers/sequences/vector.bool/move.pass.cpp
Fix MSVC warning C4800. This was implicitly converting [1, 3] to bool, which triggers an MSVC warning. The test should just pass `true`, which is simpler, has the same behavior, and avoids the warning. (This is a library test, not a compiler test, and the conversion happens before calling `push_back`, so passing [1, 3] isn't interesting in any way. This resembles a previous change to stop passing `1 == 1` in the `vector<bool>` tests.)

test/std/containers/associative/map/map.modifiers/merge.pass.cpp
test/std/containers/associative/multimap/multimap.modifiers/merge.pass.cpp
test/std/containers/associative/multiset/merge.pass.cpp
test/std/containers/associative/set/merge.pass.cpp
test/std/containers/unord/unord.map/unord.map.modifiers/merge.pass.cpp
test/std/containers/unord/unord.multimap/unord.multimap.modifiers/merge.pass.cpp
test/std/containers/unord/unord.multiset/merge.pass.cpp
test/std/containers/unord/unord.set/merge.pass.cpp
Include <cassert> for assert(). This fixes compiler errors with MSVC's STL.

test/std/containers/unord/unord.map/unord.map.modifiers/merge.pass.cpp
test/std/containers/unord/unord.multimap/unord.multimap.modifiers/merge.pass.cpp
test/std/containers/unord/unord.multiset/merge.pass.cpp
test/std/containers/unord/unord.set/merge.pass.cpp
Fix Clang -Wunused-local-typedef warnings. C++11's [hash.requirements] never required these typedefs from users.


https://reviews.llvm.org/D54508

Files:
  test/std/containers/associative/map/map.modifiers/merge.pass.cpp
  test/std/containers/associative/multimap/multimap.modifiers/merge.pass.cpp
  test/std/containers/associative/multiset/merge.pass.cpp
  test/std/containers/associative/set/merge.pass.cpp
  test/std/containers/sequences/vector.bool/move.pass.cpp
  test/std/containers/unord/unord.map/unord.map.modifiers/merge.pass.cpp
  test/std/containers/unord/unord.multimap/unord.multimap.modifiers/merge.pass.cpp
  test/std/containers/unord/unord.multiset/merge.pass.cpp
  test/std/containers/unord/unord.set/merge.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54508.173978.patch
Type: text/x-patch
Size: 7095 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20181114/67d6e4aa/attachment-0001.bin>


More information about the libcxx-commits mailing list