summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/UnwrappedLineParser.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-09-06 21:25:51 +0000
committerDaniel Jasper <djasper@google.com>2013-09-06 21:25:51 +0000
commitb4b99987137211773051c6f2524eaad75797bb1d (patch)
tree351dccbded3db0b5e15717cb18bccaf1ec4a0142 /clang/lib/Format/UnwrappedLineParser.cpp
parente934af8e5876ed1fac4015f720c05538d93ab1f7 (diff)
downloadbcm5719-llvm-b4b99987137211773051c6f2524eaad75797bb1d.tar.gz
bcm5719-llvm-b4b99987137211773051c6f2524eaad75797bb1d.zip
clang-format: Don't confuse operator[] with lambdas.
Before: double &operator[](int i) { return 0; } int i; After: double &operator[](int i) { return 0; } int i; This fixes llvm.org/PR17134. llvm-svn: 190207
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.cpp')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index 814ccf42a88..521df8f0285 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -676,7 +676,8 @@ 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)) {
+ if (!Line->Tokens.empty() &&
+ Line->Tokens.back().Tok->isOneOf(tok::identifier, tok::kw_operator)) {
nextToken();
return;
}
OpenPOWER on IntegriCloud