This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [test] Fix recently introduced warnings emitted by MSVC.
ClosedPublic

Authored by STL_MSFT on Dec 14 2016, 4:48 PM.

Details

Summary

[libcxx] [test] Fix recently introduced warnings emitted by MSVC.

test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp
test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp
test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp
test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp
These tests were using malloc()'s return value without checking for null,
which MSVC's /analyze rightly warns about. Asserting that the pointer is
non-null both expresses the test's intention and silences the warning.

test/support/controlled_allocators.hpp
Fix two unreferenced parameters by removing their names, and one unused variable by void-casting it.

test/support/uses_alloc_types.hpp
Fix an unreferenced function parameter pack by removing its name.

Diff Detail

Event Timeline

STL_MSFT updated this revision to Diff 81497.Dec 14 2016, 4:48 PM
STL_MSFT retitled this revision from to [libcxx] [test] Fix recently introduced warnings emitted by MSVC..
STL_MSFT updated this object.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.
EricWF accepted this revision.Dec 23 2016, 12:46 PM
EricWF edited edge metadata.

Sorry about that. I'm working to turn on -Wunused-parameter and others to avoid these issues.

This revision is now accepted and ready to land.Dec 23 2016, 12:46 PM

Alright. The unused parameter parts of this patch are no longer needed. -Wunused-parameter and -Wunused-variable have been enabled within libc++.

Just working on -Wsign-compare now.

-Wsign-compare has also landed :-) Now just -Wconversion to go (but that will likely take a while).

STL_MSFT closed this revision.Jan 3 2017, 5:06 PM