From: Daniel Jasper Date: Wed, 19 Apr 2017 06:06:38 +0000 (+0000) Subject: clang-format: Properly match parens of macro parameter lists. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad25f8b712f1ef99020fcb7b5e31dd95b39c6112;p=clang 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300661 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp index 004800fc2a..bbc2d1e52b 100644 --- a/lib/Format/TokenAnnotator.cpp +++ b/lib/Format/TokenAnnotator.cpp @@ -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; }