[PATCH] D136337: [clang-format] Discard pre-processor statements in parseBracedList()

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 24 21:52:19 PDT 2022


owenpan added a comment.

Can you create an issue on GitHub and include the details on how to reproduce the problem using the latest clang-format?



================
Comment at: clang/unittests/Format/FormatTest.cpp:19975-19978
+  verifyFormat("CxxClass::CxxClass() {\n#pragma region test(hello)\n}", Style);
+  EXPECT_EQ("CxxClass::CxxClass()\n#pragma region TEST(bar: foo)\n{\n#pragma region TEST(foo: bar)\n#pragma endregion\n}\nCxxClass *Hello() {}",
+            format("CxxClass::CxxClass()\n#pragma region TEST(bar: foo)\n{\n  #pragma region TEST(foo: bar)\n  #pragma endregion\n}\nCxxClass* Hello()\n{}", Style));
+
----------------
Can you clean up the tests a little? i.e. use `verifyFormat()` and have one string literal per test case line?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136337/new/

https://reviews.llvm.org/D136337



More information about the cfe-commits mailing list