[PATCH] D117840: [clang-tidy] Update bugprone-stringview-nullptr to consistently prefer the empty string when passing arguments to constructors/functions
CJ Johnson via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 20 15:07:20 PST 2022
CJ-Johnson created this revision.
Herald added subscribers: carlosgalvezp, xazax.hun.
CJ-Johnson requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D117840
Files:
clang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.cpp
clang-tools-extra/docs/clang-tidy/checks/bugprone-stringview-nullptr.rst
clang-tools-extra/test/clang-tidy/checkers/bugprone-stringview-nullptr.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117840.401793.patch
Type: text/x-patch
Size: 5289 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220120/058cf209/attachment-0001.bin>
More information about the cfe-commits
mailing list