summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-05-05 12:36:29 +0000
committerDaniel Jasper <djasper@google.com>2014-05-05 12:36:29 +0000
commit0e6c51c889bcc2088613b05ae2ca2acb64dfedbf (patch)
tree1d70b171e8dff3562c437635a991bf04911fe4d5 /clang/lib/Format
parent7721eb3f9d7bea88f138b2779b92a4ce04eab6da (diff)
downloadbcm5719-llvm-0e6c51c889bcc2088613b05ae2ca2acb64dfedbf.tar.gz
bcm5719-llvm-0e6c51c889bcc2088613b05ae2ca2acb64dfedbf.zip
clang-format: Improve understanding of decltype.
Before: SomeFunction([](decltype(x), A * a) {}); After: SomeFunction([](decltype(x), A *a) {}); llvm-svn: 207961
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 843d8777188..65c0cabffc1 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -692,7 +692,8 @@ private:
} else if (Current.isOneOf(tok::kw_return, tok::kw_throw)) {
Contexts.back().IsExpression = true;
} else if (Current.is(tok::l_paren) && !Line.MustBeDeclaration &&
- !Line.InPPDirective) {
+ !Line.InPPDirective && Current.Previous &&
+ Current.Previous->isNot(tok::kw_decltype)) {
bool ParametersOfFunctionType =
Current.Previous && Current.Previous->is(tok::r_paren) &&
Current.Previous->MatchingParen &&
OpenPOWER on IntegriCloud