[clang-tools-extra] [clang-tidy] [NFC] Move comment scanning to `LexerUtils` and add tests (PR #180371)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 11 13:47:18 PST 2026


================
@@ -124,11 +185,11 @@ std::optional<Token> getQualifyingToken(tok::TokenKind TK,
       Tok.setIdentifierInfo(&Info);
       Tok.setKind(Info.getTokenID());
     }
-    if (Tok.is(tok::less))
+    if (Tok.is(tok::less)) {
       SawTemplate = true;
-    else if (Tok.isOneOf(tok::greater, tok::greatergreater))
+    } else if (Tok.isOneOf(tok::greater, tok::greatergreater)) {
       LastMatchAfterTemplate = std::nullopt;
-    else if (Tok.is(TK)) {
+    } else if (Tok.is(TK)) {
----------------
vbvictor wrote:

Okay, we don't have 22th version for now so all new checks from 22th release (like `readability-inconsistent-ifelse-braces`) are implicitly "disabled".
As a project we will need to re-evaluate all new checks' usefullness once 22th tidy version is finally released.

What I'm worried is that it can disturb clang-format option https://clang.llvm.org/docs/ClangFormatStyleOptions.html#removebracesllvm that we now have by default.

So I'd like no drive-by fixes for typical patches.

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


More information about the cfe-commits mailing list