r300661 - clang-format: Properly match parens of macro parameter lists.

Daniel Jasper via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 18 23:06:38 PDT 2017


Author: djasper
Date: Wed Apr 19 01:06:38 2017
New Revision: 300661

URL: http://llvm.org/viewvc/llvm-project?rev=300661&view=rev
Log:
clang-format: Properly match parens of macro parameter lists.

No tests yet, but this will be tested by the upcoming:
https://reviews.llvm.org/D28462

Modified:
    cfe/trunk/lib/Format/TokenAnnotator.cpp

Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/TokenAnnotator.cpp?rev=300661&r1=300660&r2=300661&view=diff
==============================================================================
--- cfe/trunk/lib/Format/TokenAnnotator.cpp (original)
+++ cfe/trunk/lib/Format/TokenAnnotator.cpp Wed Apr 19 01:06:38 2017
@@ -796,10 +796,11 @@ private:
     while (CurrentToken) {
       FormatToken *Tok = CurrentToken;
       next();
-      if (Tok->isOneOf(Keywords.kw___has_include,
-                       Keywords.kw___has_include_next)) {
+      if (Tok->is(tok::l_paren))
+        parseParens();
+      else if (Tok->isOneOf(Keywords.kw___has_include,
+                       Keywords.kw___has_include_next))
         parseHasInclude();
-      }
     }
     return Type;
   }




More information about the cfe-commits mailing list