[clang-tools-extra] [clang-tidy][NFC] add '.clang-tidy' config for clang-tidy project (PR #147793)

Nicolas van Kempen via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 9 23:25:34 PDT 2025


================
@@ -909,10 +909,12 @@ static bool areExprsSameMacroOrLiteral(const BinaryOperator *BinOp,
     // Left is macro so right macro too
     if (Rsr.getBegin().isMacroID()) {
       // Both sides are macros so they are same macro or literal
-      const llvm::StringRef L = Lexer::getSourceText(
-          CharSourceRange::getTokenRange(Lsr), SM, Context->getLangOpts(), 0);
-      const llvm::StringRef R = Lexer::getSourceText(
-          CharSourceRange::getTokenRange(Rsr), SM, Context->getLangOpts(), 0);
+      const llvm::StringRef L =
+          Lexer::getSourceText(CharSourceRange::getTokenRange(Lsr), SM,
+                               Context->getLangOpts(), nullptr);
+      const llvm::StringRef R =
+          Lexer::getSourceText(CharSourceRange::getTokenRange(Rsr), SM,
+                               Context->getLangOpts(), nullptr);
----------------
nicovank wrote:

```suggestion
      const llvm::StringRef L = Lexer::getSourceText(
          CharSourceRange::getTokenRange(Lsr), SM, Context->getLangOpts());
      const llvm::StringRef R = Lexer::getSourceText(
          CharSourceRange::getTokenRange(Rsr), SM, Context->getLangOpts());
```

The last argument already has a default value of `nullptr`.

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


More information about the cfe-commits mailing list