Nuullll created this revision.
Nuullll added a project: clang-format.
Nuullll requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Before:

  void foo() { bar(float(1), a *b); }

After:

  void foo() { bar(float(1), a * b); }

Signed-off-by: Yilong Guo <yilong....@intel.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103589

Files:
  clang/lib/Format/TokenAnnotator.cpp


Index: clang/lib/Format/TokenAnnotator.cpp
===================================================================
--- clang/lib/Format/TokenAnnotator.cpp
+++ clang/lib/Format/TokenAnnotator.cpp
@@ -399,7 +399,7 @@
         HasMultipleParametersOnALine = true;
       if ((CurrentToken->Previous->isOneOf(tok::kw_const, tok::kw_auto) ||
            CurrentToken->Previous->isSimpleTypeSpecifier()) &&
-          !CurrentToken->is(tok::l_brace))
+          !CurrentToken->isOneOf(tok::l_brace, tok::l_paren))
         Contexts.back().IsExpression = false;
       if (CurrentToken->isOneOf(tok::semi, tok::colon)) {
         MightBeObjCForRangeLoop = false;


Index: clang/lib/Format/TokenAnnotator.cpp
===================================================================
--- clang/lib/Format/TokenAnnotator.cpp
+++ clang/lib/Format/TokenAnnotator.cpp
@@ -399,7 +399,7 @@
         HasMultipleParametersOnALine = true;
       if ((CurrentToken->Previous->isOneOf(tok::kw_const, tok::kw_auto) ||
            CurrentToken->Previous->isSimpleTypeSpecifier()) &&
-          !CurrentToken->is(tok::l_brace))
+          !CurrentToken->isOneOf(tok::l_brace, tok::l_paren))
         Contexts.back().IsExpression = false;
       if (CurrentToken->isOneOf(tok::semi, tok::colon)) {
         MightBeObjCForRangeLoop = false;
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to