[clang-tools-extra] [clang-tidy] perf-str-view-conv improvement: support c_str/data fixing (PR #181473)
Zinovy Nis via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 19 23:05:35 PST 2026
irishrover wrote:
> I'm not sure how widely used this pattern is.
Yes, sure. IMO it's an artefact when you migrate to `string_view` from `std::string`/`char*`.
> If anyone want such behavior, can they create a temporary variable to cleary indicate the intent?
I think they can. And usually it's accompanied with a comment, for example: https://source.chromium.org/chromium/chromium/src/+/main:net/http/http_response_headers.cc;l=438-439
> DO you need this option for your codebase? I'm fine if we do off-by-default option.
No, it was just a proposal to discuss. I always go through the automatic fixes, so it's not a case for me.
https://github.com/llvm/llvm-project/pull/181473
More information about the cfe-commits
mailing list