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

[libc++][test] Fix zero-length arrays and copy-pasted lambdas in...

[libc++][test] Fix zero-length arrays and copy-pasted lambdas in `ranges.contains.pass.cpp` (#79792)

* Fix MSVC error C2466: cannot allocate an array of constant size 0
  + MSVC rejects this non-Standard extension. Previous fixes: #74183
* Fix MSVC warning C4805: `'=='`: unsafe mix of type `'int'` and type
`'const bool'` in operation
+ AFAICT, these lambdas were copy-pasted, and didn't intend to take and
return `int` here. This part of the test is using `vector<bool>` for
random-access but non-contiguous iterators, and it's checking how many
times the projection is invoked, but the projection doesn't need to do
anything squirrely, it should otherwise be an identity.
* Fix typos: "continuous" => "contiguous".
parent c9535d7b
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