Unverified Commit 1c7607e8 authored by Stephan T. Lavavej's avatar Stephan T. Lavavej Committed by GitHub
Browse files

[libc++][test] Fix MSVC warning C4127 in `array.cons/initialization.pass.cpp` (#79793)



This fixes MSVC warning C4127: conditional expression is constant.

Testing `TEST_STD_AT_LEAST_20_OR_RUNTIME_EVALUATED` by itself doesn't
emit this warning, but the condition here is more complicated. I'm
expanding the macro and mechanically simplifying the resulting code.

(Yeah, this warning is often annoying, and I introduced
`TEST_STD_AT_LEAST_20_OR_RUNTIME_EVALUATED` to avoid this warning
elsewhere, so it's disappointing that it doesn't make the compiler happy
here. If this change is undesirable, I can replace it with
`ADDITIONAL_COMPILE_FLAGS(cl-style-warnings)`, but ideally I'd like to
avoid having to suppress it.)

---------

Co-authored-by: default avatarLouis Dionne <ldionne.2@gmail.com>
parent 10aed27e
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment