================
@@ -0,0 +1,71 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "AvoidDefaultLambdaCaptureCheck.h"
+#include "clang/ASTMatchers/ASTMatchFinder.h"
+#include "clang/Basic/Lambda.h"
+#include "clang/Lex/Lexer.h"
+
+using namespace clang::tidy::readability;
+
+static std::string generateCaptureText(const clang::LambdaCapture &Capture) {
+  if (Capture.capturesThis()) {
+    return Capture.getCaptureKind() == clang::LCK_StarThis ? "*this" : "this";
+  }
----------------
vbvictor wrote:

Avoid braces here and everywhere else for single-if
https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements
It should be fine without it.
You could use 
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#removebracesllvm for 
it, but you have to adjust config locally.
```suggestion
  if (Capture.capturesThis())
    return Capture.getCaptureKind() == clang::LCK_StarThis ? "*this" : "this";
```

https://github.com/llvm/llvm-project/pull/160150
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to