================ @@ -3647,15 +3647,19 @@ class IsTypeDeclaredInsideVisitor }; } // namespace -/// This function checks if the function has 'auto' return type that contains +/// This function checks if the given function has a return type that contains /// a reference (in any way) to a declaration inside the same function. -bool ASTNodeImporter::hasAutoReturnTypeDeclaredInside(FunctionDecl *D) { +bool ASTNodeImporter::hasReturnTypeDeclaredInside(FunctionDecl *D) { QualType FromTy = D->getType(); const auto *FromFPT = FromTy->getAs<FunctionProtoType>(); assert(FromFPT && "Must be called on FunctionProtoType"); + bool IsLambdaDefinition = false; + if (const auto *MD = dyn_cast<CXXMethodDecl>(D)) + IsLambdaDefinition = cast<CXXRecordDecl>(MD->getDeclContext())->isLambda(); ---------------- danix800 wrote:
> Thanks, this works, but if we are going this way, why not also check the > lambda was defined without a return type? Could you please give some direction on how to test **the lambda was defined without a return type**? Does this mean that we need to check for possible `return` statements within lambda? https://github.com/llvm/llvm-project/pull/89096 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits