[PATCH] D27270: [libcxx] [test] Fix MSVC x64 warning C4267 "conversion from 'size_t' to 'int' [or 'unsigned int'], possible loss of data", part 4/4.

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 11 13:38:45 PST 2016


EricWF accepted this revision.
EricWF added a comment.
This revision is now accepted and ready to land.

This change looks OK to me. As mentioned above I think the reason the test allocators used int/unsigned is so they could detect if the container actually propagated their typedefs.
However there are other ways to test this.



================
Comment at: test/std/utilities/allocator.adaptor/types.pass.cpp:78
 
     static_assert((std::is_same<
         std::scoped_allocator_adaptor<A2<int>, A1<int>>::size_type,
----------------
This part of the change loses test coverage. Specifically it no longer tests that `scoped_allocator_adaptor` propagates the OuterAlloc's typedefs.

I would scribble out a minimal custom allocator at the top of this file, and rewrite these static asserts using that.


https://reviews.llvm.org/D27270





More information about the cfe-commits mailing list