summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-11-02 22:46:42 +0000
committerDaniel Jasper <djasper@google.com>2014-11-02 22:46:42 +0000
commit8022226db7457e367420ac6126f07ee1568a1c04 (patch)
tree891625c26881324a5d891f752abf98c82cb9e4f5 /clang/lib/Format
parentdf2ff002f0fd203119e8d5abfbbfa71f15b1b499 (diff)
downloadbcm5719-llvm-8022226db7457e367420ac6126f07ee1568a1c04.tar.gz
bcm5719-llvm-8022226db7457e367420ac6126f07ee1568a1c04.zip
clang-format: Fix false positive in lambda detection.
Before: delete [] a -> b; After: delete[] a->b; This fixes part of llvm.org/PR21419. llvm-svn: 221114
Diffstat (limited to 'clang/lib/Format')
-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 7d54156c3bc..0c8d486f0eb 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -849,7 +849,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,
+ tok::kw_new, tok::kw_delete) ||
Line->Tokens.back().Tok->closesScope() ||
Line->Tokens.back().Tok->isSimpleTypeSpecifier())) {
nextToken();
OpenPOWER on IntegriCloud