Our static analyzer likes to warn when loop bodies are never executed, which is true for make_string<T>(""). Build the result with basic_string's iterator-pair constructor instead, which is simpler (one liner), faster (single pass), and doesn't trigger the warning.
Details
Details
- Reviewers
huixie90 philnik - Group Reviewers
Restricted Project - Commits
- rG96f1cd2427e4: [libc++][test] Silence MSVC warning
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM
libcxx/test/std/ranges/range.factories/range.istream.view/utils.h | ||
---|---|---|
9 | Seems even simpler. |
libcxx/test/std/ranges/range.factories/range.istream.view/utils.h | ||
---|---|---|
9 | The (pointer, length) constructor would only work when CharT is char, this works for any CharT to which a const char lvalue converts. Most notably that includes basic_string<wchar_t> which the tests use. |
Seems even simpler.