[clang-tools-extra] [clang-tidy] Add support for lambda-expression in `use-trailing-return-type` check (PR #135383)

Congcong Cai via cfe-commits cfe-commits at lists.llvm.org
Sun May 18 18:58:18 PDT 2025


================
@@ -56,6 +60,13 @@ class UseTrailingReturnTypeCheck : public ClangTidyCheck {
                       SourceRange ReturnTypeCVRange, const FunctionDecl &F,
                       const FriendDecl *Fr, const ASTContext &Ctx,
                       const SourceManager &SM, const LangOptions &LangOpts);
+
+  void diagOnLambda(const LambdaExpr *Lambda,
+                    const ast_matchers::MatchFinder::MatchResult &Result);
+  SourceLocation findLambdaTrailingReturnInsertLoc(const CXXMethodDecl *Method,
+                                                   const SourceManager &SM,
+                                                   const LangOptions &LangOpts,
+                                                   const ASTContext &Ctx);
----------------
HerrCai0907 wrote:

Is it really need to put these functions as class method, or we can put them as static linkage code inside cpp file? It may reduce the build time and final binary size

https://github.com/llvm/llvm-project/pull/135383


More information about the cfe-commits mailing list