aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests
diff options
context:
space:
mode:
authorOwen Pan <owenpiano@gmail.com>2024-06-05 17:57:36 -0700
committerGitHub <noreply@github.com>2024-06-05 17:57:36 -0700
commit798f2019a2fb608450c5ad5dc261d6496cf1eb15 (patch)
tree7dc0a14ea4f2ff7c5622efbbff21d9d4e2a5d4da /clang/unittests
parent62c0eaeec9a65c73f3bee0b8b05461f1c628d27c (diff)
downloadllvm-798f2019a2fb608450c5ad5dc261d6496cf1eb15.zip
llvm-798f2019a2fb608450c5ad5dc261d6496cf1eb15.tar.gz
llvm-798f2019a2fb608450c5ad5dc261d6496cf1eb15.tar.bz2
[clang-format] Don't format comments in SkipMacroDefinitionBody (#94425)
Fixes #94326.
Diffstat (limited to 'clang/unittests')
-rw-r--r--clang/unittests/Format/FormatTest.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 004ecb6..4e42726 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -24879,7 +24879,7 @@ TEST_F(FormatTest, SkipMacroDefinitionBody) {
Style);
// With comments.
- verifyFormat("/* */ #define A a // a a", "/* */ # define A a // a a",
+ verifyFormat("/* */ #define A a // a a", "/* */ # define A a // a a",
Style);
verifyNoChange("/* */ #define A a // a a", Style);
@@ -24891,6 +24891,15 @@ TEST_F(FormatTest, SkipMacroDefinitionBody) {
"int aaa; // a",
Style);
+ verifyNoChange(
+ "#define MACRO_WITH_COMMENTS() \\\n"
+ " public: \\\n"
+ " /* Documentation parsed by Doxygen for the following method. */ \\\n"
+ " static MyType getClassTypeId(); \\\n"
+ " /** Normal comment for the following method. */ \\\n"
+ " virtual MyType getTypeId() const;",
+ Style);
+
// multiline macro definitions
verifyNoChange("#define A a\\\n"
" A a \\\n "