clang-format: Properly match parens of macro parameter lists.
authorDaniel Jasper <djasper@google.com>
Wed, 19 Apr 2017 06:06:38 +0000 (06:06 +0000)
committerDaniel Jasper <djasper@google.com>
Wed, 19 Apr 2017 06:06:38 +0000 (06:06 +0000)
No tests yet, but this will be tested by the upcoming:
https://reviews.llvm.org/D28462

llvm-svn: 300661

clang/lib/Format/TokenAnnotator.cpp

index 004800f..bbc2d1e 100644 (file)
@@ -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;
   }