Index: clang/lib/Format/UnwrappedLineParser.cpp =================================================================== --- clang/lib/Format/UnwrappedLineParser.cpp +++ clang/lib/Format/UnwrappedLineParser.cpp @@ -2127,6 +2127,7 @@ case tok::coloncolon: case tok::kw_mutable: case tok::kw_noexcept: + case tok::kw_constexpr: nextToken(); break; // Specialization of a template with an integer parameter can contain Index: clang/unittests/Format/TokenAnnotatorTest.cpp =================================================================== --- clang/unittests/Format/TokenAnnotatorTest.cpp +++ clang/unittests/Format/TokenAnnotatorTest.cpp @@ -894,6 +894,13 @@ EXPECT_TOKEN(Tokens[9], tok::l_brace, TT_ObjCBlockLBrace); } +TEST_F(TokenAnnotatorTest, UnderstandsLambdas) { + auto Tokens = annotate("[]() constexpr {}"); + ASSERT_EQ(Tokens.size(), 8u) << Tokens; + EXPECT_TOKEN(Tokens[0], tok::l_square, TT_LambdaLSquare); + EXPECT_TOKEN(Tokens[5], tok::l_brace, TT_LambdaLBrace); +} + } // namespace } // namespace format } // namespace clang