[clang] [clang-format] Fix annotating paren after in (PR #206810)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 2 12:08:30 PDT 2026


================
@@ -2821,8 +2821,10 @@ class AnnotatingParser {
       // If there is an identifier (or with a few exceptions a keyword) right
       // before the parentheses, this is unlikely to be a cast.
       if (LeftOfParens->Tok.getIdentifierInfo() &&
-          LeftOfParens->isNoneOf(Keywords.kw_in, tok::kw_return, tok::kw_case,
-                                 tok::kw_delete, tok::kw_throw)) {
+          (LeftOfParens->isNoneOf(Keywords.kw_in, tok::kw_return, tok::kw_case,
+                                  tok::kw_delete, tok::kw_throw) ||
+           (LeftOfParens->Previous &&
+            LeftOfParens->Previous->is(tok::period)))) {
----------------
HazardyKnusperkeks wrote:

Didn't knew about that. Did drop the additional checks.

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


More information about the cfe-commits mailing list