djasper added a comment. Please add tests in unittests/Format/FormatTest.cpp.
================ Comment at: lib/Format/UnwrappedLineParser.cpp:1086 @@ +1085,3 @@ + int parens = 0; + while (!eof()) { + if (FormatTok->isOneOf(tok::l_paren, tok::l_square)) { ---------------- We need to be much more error resilient here as people will frequently call clang-format with mismatched parentheses and such. I am actually quite skeptical about having yet another instance of parentheses counting. Maybe just call parseParens() instead? ================ Comment at: lib/Format/UnwrappedLineParser.cpp:1094 @@ +1093,3 @@ + } else if (!FormatTok->isOneOf(tok::identifier, tok::coloncolon)) { + return false; + } ---------------- This seems wrong. Even in the case of the bug you say you are fixing, the "23" is neither an identifier nor a coloncolon.. http://reviews.llvm.org/D18793 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits