[PATCH] D151383: [clang-tidy] Check for specific return types on all functions

NagaChaitanya Vellanki via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 26 13:31:26 PDT 2023


chaitanyav added a comment.

In D151383#4377043 <https://reviews.llvm.org/D151383#4377043>, @PiotrZSL wrote:

> LGTM, you may consider reducing commit message (aka review description by removing example and error from it, and leaving just plain description of a change).

got it, will make sure to remove them from the arc generated commit message.



================
Comment at: clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp:159
+                   anyOf(isInstantiatedFrom(hasAnyName(FunVec)),
+                         hasAnyReturnType(RetTypeVec)))))
           .bind("match"))));
----------------
PiotrZSL wrote:
> Consider:
> 
> hasAnyReturnType -> `returns(hasCanonicalType(hasDeclaration(namedDecl(matchers::matchesAnyListedName(RetTypeVec))))`
> Note that to use matchesAnyListedName, you should save RetTypeVec  as class member, just to be safe.
I followed the code in ForRangeCopyCheck.cpp and made the changes accordingly.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151383



More information about the cfe-commits mailing list