[PATCH] D140267: [clang-format] Allow line break between template closer and right paren

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 18 01:35:26 PST 2022


HazardyKnusperkeks added a comment.

Maybe do not limit to `JsTypeColon` but all colons? What about something like `f(some_template<Variable>).method()`? I'd have to check where it breaks if there isn't a template in the argument, but I'd guess not before the paren.



================
Comment at: clang/lib/Format/TokenAnnotator.cpp:4953-4958
   if (Left.is(TT_TemplateCloser) && Right.is(TT_TemplateOpener))
     return true;
+  if (Left.is(TT_TemplateCloser) && Right.is(tok::r_paren) &&
+      (!Right.Next || Right.Next->isNot(TT_JsTypeColon))) {
+    return true;
+  }
----------------
Could you merge this?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140267/new/

https://reviews.llvm.org/D140267



More information about the cfe-commits mailing list