[PATCH] D115121: Update bugprone-stringview-nullptr to support return statements and constructors for any T which accepts basic_string_view

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 12 13:52:48 PST 2022


ymandel added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.cpp:263
+  auto HandleConstructorInvocation =
+      makeRule(cxxConstructExpr(hasAnyArgument(ignoringImpCasts(
+                                    BasicStringViewConstructingFromNullExpr)),
----------------
CJ-Johnson wrote:
> ymandel wrote:
> > precede with `argumentCountIs(1)`? Also, please comment on choice of `hasAnyArgument` (copying what you wrote in the patch description is fine).
> Added the code comments, but not the argument count matcher. This case intentionally matches any number of arguments since some types make take 2+ parameters where one of them is string_view.
got it. I misunderstood the existing comment. thx


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115121/new/

https://reviews.llvm.org/D115121



More information about the cfe-commits mailing list