diff options
| author | Daniel Jasper <djasper@google.com> | 2014-01-22 17:01:47 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2014-01-22 17:01:47 +0000 |
| commit | 76f9c8295f513bd37bbcf6a90adef4478ccc22b6 (patch) | |
| tree | 14d7fa30078171aca10945f369049a4320c3d0fc /lib/Format/UnwrappedLineParser.cpp | |
| parent | 93574ce14f6efbb1f7e7502f47f1328f446682cd (diff) | |
| download | clang-76f9c8295f513bd37bbcf6a90adef4478ccc22b6.tar.gz clang-76f9c8295f513bd37bbcf6a90adef4478ccc22b6.tar.bz2 clang-76f9c8295f513bd37bbcf6a90adef4478ccc22b6.tar.xz | |
clang-format: Fix incorrect lambda recognition.
Before:
std::unique_ptr<int[]> foo() {}
After:
std::unique_ptr<int []> foo() {}
Also, the formatting could go severely wrong after such a function
before.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199817 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/UnwrappedLineParser.cpp')
| -rw-r--r-- | lib/Format/UnwrappedLineParser.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp index d5423d1283..6e18ad352a 100644 --- a/lib/Format/UnwrappedLineParser.cpp +++ b/lib/Format/UnwrappedLineParser.cpp @@ -753,7 +753,8 @@ bool 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->isOneOf(tok::identifier, tok::kw_operator)) { + (Line->Tokens.back().Tok->isOneOf(tok::identifier, tok::kw_operator) || + Line->Tokens.back().Tok->isSimpleTypeSpecifier())) { nextToken(); return false; } |
