clang-format: Fix incorrect lambda-detection.

Before:
  [ a, a ]() -> a<1>{};

After:
  [a, a]() -> a<1> {};

llvm-svn: 244890
This commit is contained in:
Daniel Jasper 2015-08-13 13:37:08 +00:00
parent a887f06214
commit 5eaa009e57
2 changed files with 2 additions and 0 deletions

View File

@ -1000,6 +1000,7 @@ bool UnwrappedLineParser::tryToParseLambda() {
case tok::less:
case tok::greater:
case tok::identifier:
case tok::numeric_constant:
case tok::coloncolon:
case tok::kw_mutable:
nextToken();

View File

@ -10003,6 +10003,7 @@ TEST_F(FormatTest, FormatsLambdas) {
verifyGoogleFormat("auto a = [&b, c](D* d) -> pair<D*, D*> {};");
verifyGoogleFormat("auto a = [&b, c](D* d) -> D& {};");
verifyGoogleFormat("auto a = [&b, c](D* d) -> const D* {};");
verifyFormat("[a, a]() -> a<1> {};");
verifyFormat("auto aaaaaaaa = [](int i, // break for some reason\n"
" int j) -> int {\n"
" return ffffffffffffffffffffffffffffffffffffffffffff(i * j);\n"