diff options
author | Manuel Klimek <klimek@google.com> | 2017-09-20 09:29:37 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2017-09-20 09:29:37 +0000 |
commit | e411aa85acffbd8da2ea332e6acf86b7f6804192 (patch) | |
tree | c3fb11d551dc4c654c67bb3ed179c8a59934e6e7 /clang/lib/Format/UnwrappedLineParser.h | |
parent | 94444b9a0778d076a73bd430f69ea84aff7185d5 (diff) | |
download | bcm5719-llvm-e411aa85acffbd8da2ea332e6acf86b7f6804192.tar.gz bcm5719-llvm-e411aa85acffbd8da2ea332e6acf86b7f6804192.zip |
Fix clang-format's detection of structured bindings.
Correctly determine when [ is part of a structured binding instead of a
lambda.
To be able to reuse the implementation already available, this patch also:
- sets the Previous link of FormatTokens in the UnwrappedLineParser
- moves the isCppStructuredBinding function into FormatToken
Before:
auto const const &&[x, y] { A *i };
After:
auto const const && [x, y]{A * i};
Fixing formatting of the type of the structured binding is still missing.
llvm-svn: 313742
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.h')
-rw-r--r-- | clang/lib/Format/UnwrappedLineParser.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.h b/clang/lib/Format/UnwrappedLineParser.h index 93b3bfafbad..a4b5576f92d 100644 --- a/clang/lib/Format/UnwrappedLineParser.h +++ b/clang/lib/Format/UnwrappedLineParser.h @@ -129,7 +129,6 @@ private: // - if the token is '}' and closes a block, LevelDifference is -1. void nextToken(int LevelDifference = 0); void readToken(int LevelDifference = 0); - const FormatToken *getPreviousToken(); // Decides which comment tokens should be added to the current line and which // should be added as comments before the next token. |