From 0e6c51c889bcc2088613b05ae2ca2acb64dfedbf Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Mon, 5 May 2014 12:36:29 +0000 Subject: clang-format: Improve understanding of decltype. Before: SomeFunction([](decltype(x), A * a) {}); After: SomeFunction([](decltype(x), A *a) {}); llvm-svn: 207961 --- clang/lib/Format/TokenAnnotator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/Format') 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 && -- cgit v1.2.3