diff options
author | Björn Schäpers <bjoern@hazardy.de> | 2022-07-16 23:46:18 +0200 |
---|---|---|
committer | Björn Schäpers <bjoern@hazardy.de> | 2022-07-18 21:42:34 +0200 |
commit | d2eda49202386b222cec763aad9aaecd463ce044 (patch) | |
tree | e87cea494350bb3dd543b5fe34eb4984381d56bc /clang/unittests | |
parent | 3c18a8b3a349781eac54144d0cf252bbbce0c4c1 (diff) | |
download | llvm-d2eda49202386b222cec763aad9aaecd463ce044.zip llvm-d2eda49202386b222cec763aad9aaecd463ce044.tar.gz llvm-d2eda49202386b222cec763aad9aaecd463ce044.tar.bz2 |
[clang-format] Mark constexpr lambdas as lambda
Otherwise the brace was detected as a function brace, not wrong per se,
but when directly calling the lambda the calling parens were put on the
next line.
Differential Revision: https://reviews.llvm.org/D129946
Diffstat (limited to 'clang/unittests')
-rw-r--r-- | clang/unittests/Format/TokenAnnotatorTest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/Format/TokenAnnotatorTest.cpp b/clang/unittests/Format/TokenAnnotatorTest.cpp index ed6fb41..bdbfca7 100644 --- a/clang/unittests/Format/TokenAnnotatorTest.cpp +++ b/clang/unittests/Format/TokenAnnotatorTest.cpp @@ -894,6 +894,13 @@ TEST_F(TokenAnnotatorTest, UnderstandsObjCBlock) { 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 |