This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [test] Fix MSVC warnings and errors.
ClosedPublic

Authored by STL_MSFT on Feb 13 2018, 7:34 PM.

Details

Summary

[libcxx] [test] Fix MSVC warnings and errors.

test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp
test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp
test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp
test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp
test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
Fix MSVC x64 truncation warnings.
warning C4267: conversion from 'size_t' to 'int', possible loss of data

test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
Fix MSVC uninitialized memory warning.
warning C6001: Using uninitialized memory 'vl'.

test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp
Include <cassert> for the assert() macro.

Diff Detail

Event Timeline

STL_MSFT created this revision.Feb 13 2018, 7:34 PM

The <cassert> bit is fine.
The veryLarge is "ok".
The rest of them are just bogus.

Would pragmas guarded by _MSC_VER be acceptable for the truncation warnings?

mclow.lists added inline comments.Feb 19 2018, 7:41 PM
test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
80

What if we just made the containers vector<size_t> ? (and triangle)

STL_MSFT updated this revision to Diff 135352.Feb 21 2018, 6:32 PM

Update based on code review feedback.

mclow.lists accepted this revision.Feb 24 2018, 8:15 AM

LGTM - thanks!

This revision is now accepted and ready to land.Feb 24 2018, 8:15 AM
STL_MSFT closed this revision.Feb 26 2018, 12:51 PM