Skip to content
Commit 9c8bc090 authored by Mike Crowe's avatar Mike Crowe Committed by Piotr Zegar
Browse files

[clang-tidy] Fix readability-redundant-string-cstr for smart pointer #576705

Fix the readability-redundant-string-cstr check to correctly replace
calls to c_str() via an overloaded operator-> (such as from an
iterator.)

Previously, the fix for `i->c_str()` would be `*i->`. Using consume_back
to remove any trailing `->` results in the correct `*i`.

Add some lit check test cases too.

Fixes: https://github.com/llvm/llvm-project/issues/56705

Reviewed By: PiotrZSL

Differential Revision: https://reviews.llvm.org/D145730
parent 2eada459
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment