summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-10-26 12:08:47 +0000
committerDaniel Jasper <djasper@google.com>2015-10-26 12:08:47 +0000
commit74331d4c433053fc39e4c572c340f3bc1810b312 (patch)
tree833d212b6345b3140383399c3108cc3aa1e3a0c4 /clang/lib/Format
parent84d7a40c7a07a3e3b6398fc5abd451e05ddb9df1 (diff)
downloadbcm5719-llvm-74331d4c433053fc39e4c572c340f3bc1810b312.tar.gz
bcm5719-llvm-74331d4c433053fc39e4c572c340f3bc1810b312.zip
clang-format: Fix false positive in cast detection.
Before (with spaces in parentheses): void inFunction() { std::function<void( int, int )> fct; } After: void inFunction() { std::function<void( int, int)> fct; } llvm-svn: 251284
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index fbd7fe4f6f4..8ec11ced1d4 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1086,7 +1086,8 @@ private:
Tok.Previous->isOneOf(TT_PointerOrReference, TT_TemplateCloser) ||
Tok.Previous->isSimpleTypeSpecifier();
bool ParensCouldEndDecl =
- Tok.Next && Tok.Next->isOneOf(tok::equal, tok::semi, tok::l_brace);
+ Tok.Next &&
+ Tok.Next->isOneOf(tok::equal, tok::semi, tok::l_brace, tok::greater);
bool IsSizeOfOrAlignOf =
LeftOfParens && LeftOfParens->isOneOf(tok::kw_sizeof, tok::kw_alignof);
if (ParensAreType && !ParensCouldEndDecl && !IsSizeOfOrAlignOf &&
OpenPOWER on IntegriCloud