[libcxx-commits] [libcxx] [libc++][test] Avoid narrowing operations in `pair`'s constructors for tests for `flat_(multi)map` whenever feasible (PR #131284)

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 17 10:44:57 PDT 2025


================
@@ -29,7 +29,9 @@ int main(int, char**) {
     std::vector<char, test_allocator<char>> vs({2, 2, 1}, test_allocator<char>(7));
----------------
mordante wrote:

Wouldn't this work instead?
```suggestion
    std::vector<char, test_allocator<char>> vs({'2', '2', '1'}, test_allocator<char>(7));
```
I'm not fond that the existing code uses char as an arithmetic value instead of a character value.

https://github.com/llvm/llvm-project/pull/131284


More information about the libcxx-commits mailing list