[clang-tools-extra] [clang-tidy] Add a new check 'bugprone-redundant-string-view-conversions' (PR #174288)

Tommy Chen via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 5 05:58:48 PST 2026


dl8sd11 wrote:


> > * should be a readability check. (together with other `readability-redundant-*`) or you have objections to it?
> 
> For me it's more about bugs (reference to temporary object) or perf (https://godbolt.org/z/En1744M63). Maybe the word `redundant` is confusing and should be removed: `bugprone-string-view-conversions`?

Agree that creating a temp string for a string_view parameter could cause bugs sometimes.

Here is an example: https://clang-tidy.godbolt.org/z/35d5Yadec

But I think that depends case by case, performance is an obvious and general reason for this check. WDUT?



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


More information about the cfe-commits mailing list