This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Update bugprone-stringview-nullptr to consistently prefer the empty string when passing arguments to constructors/functions
ClosedPublic

Authored by CJ-Johnson on Jan 20 2022, 3:07 PM.

Details

Summary

Previously, function(nullptr) would have been fixed with function({}). This unfortunately can change overload resolution and even become ambiguous. T(nullptr) was already being fixed with T(""), so this change just brings function calls in line with that.

Diff Detail

Event Timeline

CJ-Johnson created this revision.Jan 20 2022, 3:07 PM
CJ-Johnson requested review of this revision.Jan 20 2022, 3:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2022, 3:07 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision was not accepted when it landed; it landed in state Needs Review.Jan 20 2022, 3:08 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.