diff options
| author | Daniel Jasper <djasper@google.com> | 2013-09-05 11:49:39 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2013-09-05 11:49:39 +0000 |
| commit | bf02b2c186c0d317849379711a0d7b08ff933d23 (patch) | |
| tree | aa5a10cc9d54b3be9e14780328df19cb5f487169 /clang/lib/Format | |
| parent | 5e0b2085c8be40eb9e1c6b7fe3e9651edc53c906 (diff) | |
| download | bcm5719-llvm-bf02b2c186c0d317849379711a0d7b08ff933d23.tar.gz bcm5719-llvm-bf02b2c186c0d317849379711a0d7b08ff933d23.zip | |
clang-format: Quickfix for braced init lists detected as lambdas.
Before:
constexpr char hello [] { "hello" };
After:
constexpr char hello[]{ "hello" };
llvm-svn: 190046
Diffstat (limited to 'clang/lib/Format')
| -rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 13b9847527a..5029bd689bc 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -674,6 +674,12 @@ void UnwrappedLineParser::parseStructuralElement() { } void UnwrappedLineParser::tryToParseLambda() { + // FIXME: This is a dirty way to access the previous token. Find a better + // solution. + if (!Line->Tokens.empty() && Line->Tokens.back().Tok->is(tok::identifier)) { + nextToken(); + return; + } assert(FormatTok->is(tok::l_square)); FormatToken &LSquare = *FormatTok; if (!tryToParseLambdaIntroducer()) |

