[all-commits] [llvm/llvm-project] 1c7607: [libc++][test] Fix MSVC warning C4127 in `array.co...

Stephan T. Lavavej via All-commits all-commits at lists.llvm.org
Sat Mar 9 02:32:19 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1c7607e8ee6ec4ca3abce1561dd39a98d4efac96
      https://github.com/llvm/llvm-project/commit/1c7607e8ee6ec4ca3abce1561dd39a98d4efac96
  Author: Stephan T. Lavavej <stl at nuwen.net>
  Date:   2024-03-09 (Sat, 09 Mar 2024)

  Changed paths:
    M libcxx/test/std/containers/sequences/array/array.cons/initialization.pass.cpp

  Log Message:
  -----------
  [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: Louis Dionne <ldionne.2 at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list