[all-commits] [llvm/llvm-project] c9535d: [libc++][test] Silence MSVC warnings (#79791)

Stephan T. Lavavej via All-commits all-commits at lists.llvm.org
Mon Jan 29 02:53:17 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c9535d7b61a37d6fa58e51222a9ccecc54431193
      https://github.com/llvm/llvm-project/commit/c9535d7b61a37d6fa58e51222a9ccecc54431193
  Author: Stephan T. Lavavej <stl at nuwen.net>
  Date:   2024-01-29 (Mon, 29 Jan 2024)

  Changed paths:
    M libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp
    M libcxx/test/std/algorithms/alg.nonmodifying/alg.fold/left_folds.pass.cpp
    M libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.pointer.pass.cpp

  Log Message:
  -----------
  [libc++][test] Silence MSVC warnings (#79791)

* `libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp`
emits a bunch of warnings, all caused by what appears to be intentional
code:
+ Silence MSVC warning C4245: conversion from `'int'` to `'wchar_t'`,
signed/unsigned mismatch
    - Caused by: `test<U>(0, -1);`
+ Silence MSVC warning C4305: 'argument': truncation from `'int'` to
`'bool'`
    - Caused by: `test<U>(0, -1);`
  + Silence MSVC warning C4310: cast truncates constant value
    - Caused by: `test<U>(T(-129), U(-129));`
+ Silence MSVC warning C4805: `'=='`: unsafe mix of type `'char'` and
type `'bool'` in operation
    - Caused by: `bool expect_match = val == to_find;`
*
`libcxx/test/std/algorithms/alg.nonmodifying/alg.fold/left_folds.pass.cpp`
+ Silence MSVC warning C4244: 'argument': conversion from `'double'` to
`'const int'`, possible loss of data
- Caused by `[](int const x, double const y) { return x + y; }`
deliberately being given `double`s to truncate.
*
`libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.pointer.pass.cpp`
  + Silence MSVC warnings about C++20 deprecated `volatile`.
    - Caused by: `runtime_test<      volatile T>();`




More information about the All-commits mailing list