[PATCH] D120401: [clang-format][NFC] Rename test and remove comments
Björn Schäpers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Feb 26 12:23:27 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa74ff3ac2edc: [clang-format][NFC] Rename test and remove comments (authored by HazardyKnusperkeks).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120401/new/
https://reviews.llvm.org/D120401
Files:
clang/unittests/Format/TokenAnnotatorTest.cpp
Index: clang/unittests/Format/TokenAnnotatorTest.cpp
===================================================================
--- clang/unittests/Format/TokenAnnotatorTest.cpp
+++ clang/unittests/Format/TokenAnnotatorTest.cpp
@@ -44,9 +44,7 @@
EXPECT_TOKEN_TYPE(FormatTok, Type); \
} while (false)
-TEST_F(TokenAnnotatorTest, UnderstandsUsesOfStarAndAmpInMacroDefinition) {
- // This is a regression test for mis-parsing the & after decltype as a binary
- // operator instead of a reference (when inside a macro definition).
+TEST_F(TokenAnnotatorTest, UnderstandsUsesOfStarAndAmp) {
auto Tokens = annotate("auto x = [](const decltype(x) &ptr) {};");
EXPECT_EQ(Tokens.size(), 18u) << Tokens;
EXPECT_TOKEN(Tokens[7], tok::kw_decltype, TT_Unknown);
@@ -54,13 +52,12 @@
EXPECT_TOKEN(Tokens[9], tok::identifier, TT_Unknown);
EXPECT_TOKEN(Tokens[10], tok::r_paren, TT_TypeDeclarationParen);
EXPECT_TOKEN(Tokens[11], tok::amp, TT_PointerOrReference);
- // Same again with * instead of &:
+
Tokens = annotate("auto x = [](const decltype(x) *ptr) {};");
EXPECT_EQ(Tokens.size(), 18u) << Tokens;
EXPECT_TOKEN(Tokens[10], tok::r_paren, TT_TypeDeclarationParen);
EXPECT_TOKEN(Tokens[11], tok::star, TT_PointerOrReference);
- // Also check that we parse correctly within a macro definition:
Tokens = annotate("#define lambda [](const decltype(x) &ptr) {}");
EXPECT_EQ(Tokens.size(), 17u) << Tokens;
EXPECT_TOKEN(Tokens[7], tok::kw_decltype, TT_Unknown);
@@ -68,7 +65,7 @@
EXPECT_TOKEN(Tokens[9], tok::identifier, TT_Unknown);
EXPECT_TOKEN(Tokens[10], tok::r_paren, TT_TypeDeclarationParen);
EXPECT_TOKEN(Tokens[11], tok::amp, TT_PointerOrReference);
- // Same again with * instead of &:
+
Tokens = annotate("#define lambda [](const decltype(x) *ptr) {}");
EXPECT_EQ(Tokens.size(), 17u) << Tokens;
EXPECT_TOKEN(Tokens[10], tok::r_paren, TT_TypeDeclarationParen);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120401.411636.patch
Type: text/x-patch
Size: 1958 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220226/ef7024cd/attachment.bin>
More information about the cfe-commits
mailing list