[clang-tools-extra] [clang-tidy] Add a new check 'replace-with-string-view' (PR #172170)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 16 23:50:34 PST 2025


vbvictor wrote:

> Maybe it worth to merge the PR in the current state and then I'll add options support and other optimizations as separate commits not to overcomplicate this PR?

Sure, we can go like this.
I'll try to re-review it soon.

For now, could we change check name to `modernize-use-string-view`, WDYT?

We have this issue https://github.com/llvm/llvm-project/issues/29059 to covert string to string_veiw. And I think `modernize-use-string-view` check can be easily extended to convert global `string a = "text"` to `string_view a = "text"`.

So it's better to give a generic name to cover more cases in the future rather than having multiple smaller checks.




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


More information about the cfe-commits mailing list