This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Support std::string_view in readability-redundant-string-cstr
ClosedPublic

Authored by tberghammer on Dec 14 2022, 6:01 AM.

Details

Summary

Previously we were matching constructor calls for std::string and
llvm::StringRef and this change extends this set with including
std::string_view as well.

Diff Detail

Event Timeline

tberghammer created this revision.Dec 14 2022, 6:01 AM
Herald added a project: Restricted Project. · View Herald Transcript
tberghammer requested review of this revision.Dec 14 2022, 6:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2022, 6:01 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Please document the changes in the Release Notes.

Add release notes

Fix formatting type in release notes

carlosgalvezp accepted this revision.Dec 14 2022, 10:31 AM

LGTM! Perhaps give the other reviewers a couple days to take a look in case I've missed anything.

This revision is now accepted and ready to land.Dec 14 2022, 10:31 AM
njames93 added inline comments.Dec 15 2022, 1:52 PM
clang-tools-extra/test/clang-tidy/checkers/readability/redundant-string-cstr.cpp
56

Can you add typedefs and tests for wstring_view and others

Add wstring_view test

carlosgalvezp accepted this revision.Dec 19 2022, 11:07 PM

LGTM, perhaps give a couple days to @njames93 to give a final look?

njames93 accepted this revision.Dec 21 2022, 12:17 AM

LGTM, thank you for the patch

@tberghammer Do you need help to land the patch?

This revision was landed with ongoing or failed builds.Jan 2 2023, 3:24 AM
This revision was automatically updated to reflect the committed changes.

Sorry, I was away during the holidays but just pushed the change.