This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [test] Resolve C1XX warning in new vector<bool>::size tests caused by assert(true)
ClosedPublic

Authored by BillyONeal on Nov 21 2017, 2:53 PM.

Details

Summary

In a17cd7c641c34b6c4bd4845a4d4fb590cb6c238c Marshall added assert(true) to the vector<bool>::size tests, which break on C1XX:
D:\Contest\gl0qojfu.5pe\src\qa\vc\libs\libcxx\upstream\test\std\containers\sequences\vector.bool\size.pass.cpp(62): error C2220: warning treated as error - no 'object' file generated
d:\contest\gl0qojfu.5pe\src\qa\vc\libs\libcxx\upstream\test\std\containers\sequences\vector.bool\size.pass.cpp(33) : warning C6326: Potential comparison of a constant with another constant.
d:\contest\gl0qojfu.5pe\src\qa\vc\libs\libcxx\upstream\test\std\containers\sequences\vector.bool\size.pass.cpp(52) : warning C6326: Potential comparison of a constant with another constant.

The corresponding test for vector::size asserts assert(c.size() == 3);, so I changed it to do that here.

Diff Detail

Event Timeline

BillyONeal created this revision.Nov 21 2017, 2:53 PM
EricWF accepted this revision.Nov 21 2017, 2:58 PM
This revision is now accepted and ready to land.Nov 21 2017, 2:58 PM
BillyONeal closed this revision.Nov 21 2017, 3:03 PM

Committed r318812

mclow.lists edited edge metadata.Nov 21 2017, 5:30 PM

D'Oh - that was a paste that went wrong.
You are correct that assert(c.size() == 3) is correct.

However, what I was *trying* to fix were the lines before.
Pushing a 3 into a vector<bool> is not the best idea L#34 and L#53 should both read c.push_back(true);