[libcxx] [test] In random tests, use real static_asserts and silence a warning.
One test triggers MSVC's warning C4310 "cast truncates constant value".
The code is valid, and yet the warning is valid, so I'm silencing it
through push-disable-pop.
Paths
| Differential D26812
[libcxx] [test] In random tests, use real static_asserts and silence a warning. ClosedPublic Authored by STL_MSFT on Nov 17 2016, 1:33 PM.
Details
Summary [libcxx] [test] In random tests, use real static_asserts and silence a warning. One test triggers MSVC's warning C4310 "cast truncates constant value".
Diff Detail Event TimelineComment Actions Fun libc++ fact: We implement almost all of the C++11 library in C++03. These tests use assert because min() is not constexpr in C++03. If you don't mind please change the tests to: #if TEST_STD_VER >= 11 static_assert(...); #else assert(...); #endif Feel free to commit after making those changes.
Comment Actions Made the requested changes, committed as r287391 with Eric's approval.
This revision is now accepted and ready to land.Nov 18 2016, 3:00 PM
Revision Contents
Diff 78411 test/std/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp
test/std/numerics/rand/rand.adapt/rand.adapt.ibits/values.pass.cpp
test/std/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp
test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp
test/std/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp
test/std/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp
|
Warning "4310"? #pragma GCC warning ignored "-Wwarning-name" is so much better. Your compiler is bad and you should feel bad. :-P