aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/TokenAnnotatorTest.cpp
diff options
context:
space:
mode:
authorOwen Pan <owenpiano@gmail.com>2025-03-31 23:16:41 -0700
committerGitHub <noreply@github.com>2025-03-31 23:16:41 -0700
commitd3be29642fa65e5ade434d860cfcc193f8278d4e (patch)
tree4d97c9f94b0a795f7b61b96ee6597c431a990b7c /clang/unittests/Format/TokenAnnotatorTest.cpp
parentbae3577002b6bda92837723a06a4ca5c498d300f (diff)
downloadllvm-d3be29642fa65e5ade434d860cfcc193f8278d4e.zip
llvm-d3be29642fa65e5ade434d860cfcc193f8278d4e.tar.gz
llvm-d3be29642fa65e5ade434d860cfcc193f8278d4e.tar.bz2
[clang-format] Correctly annotate pointer/reference in _Generic (#133673)
Fix #133663
Diffstat (limited to 'clang/unittests/Format/TokenAnnotatorTest.cpp')
-rw-r--r--clang/unittests/Format/TokenAnnotatorTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/TokenAnnotatorTest.cpp b/clang/unittests/Format/TokenAnnotatorTest.cpp
index ac5e979..af9fd57 100644
--- a/clang/unittests/Format/TokenAnnotatorTest.cpp
+++ b/clang/unittests/Format/TokenAnnotatorTest.cpp
@@ -363,6 +363,10 @@ TEST_F(TokenAnnotatorTest, UnderstandsUsesOfStarAndAmp) {
ASSERT_EQ(Tokens.size(), 20u) << Tokens;
EXPECT_TOKEN(Tokens[14], tok::star, TT_PointerOrReference);
+ Tokens = annotate("#define foo(x) _Generic(x, bar *: 1, default: 0)");
+ ASSERT_EQ(Tokens.size(), 20u) << Tokens;
+ EXPECT_TOKEN(Tokens[11], tok::star, TT_PointerOrReference);
+
Tokens = annotate("Thingy kConfig = {\n"
" 1,\n"
" (uint16_t)(kScale * height_pixels),\n"