[clang-tools-extra] [clang-tidy] modernize-avoid-bind only return for non-void function (PR #69207)
Piotr Zegar via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 16 07:45:21 PDT 2023
================
@@ -554,6 +555,8 @@ getLambdaProperties(const MatchFinder::MatchResult &Result) {
LP.Callable.Materialization = getCallableMaterialization(Result);
LP.Callable.Decl =
getCallMethodDecl(Result, LP.Callable.Type, LP.Callable.Materialization);
+ if (LP.Callable.Decl)
+ LP.Callable.DoesReturn = !LP.Callable.Decl->getReturnType()->isVoidType();
----------------
PiotrZSL wrote:
check here also that return type is not null, just in case..., you may also try to check a canonical type, in case that void would be somehow hidden behind some typedefs/templates or something
https://github.com/llvm/llvm-project/pull/69207
More information about the cfe-commits
mailing list