[PATCH] D149643: [clang-format] Correctly limit formatted ranges when specifying qualifier alignment

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 2 15:29:23 PDT 2023


owenpan accepted this revision.
owenpan added inline comments.


================
Comment at: clang/unittests/Format/QualifierFixerTest.cpp:1351
+
+  // Only the first line should be formatted the second should remain as is
+  EXPECT_EQ("template <typename T> const Foo f();\n"
----------------



================
Comment at: clang/unittests/Format/QualifierFixerTest.cpp:1352-1357
+  EXPECT_EQ("template <typename T> const Foo f();\n"
+            "template <typename T> Foo const f();",
+            format("template <typename T> Foo const f();\n"
+                   "template <typename T> Foo const f();",
+                   Style, SC_ExpectComplete,
+                   std::vector<tooling::Range>(1, tooling::Range(0, 36))));
----------------
Please use `verifyFormat` instead of `EXPECT_EQ` here and below.


================
Comment at: clang/unittests/Format/QualifierFixerTest.cpp:1359-1360
+
+  // Only the middle line should be formatted the first and last should remain
+  // as is
+  EXPECT_EQ("template <typename T> Foo const f();\n"
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149643



More information about the cfe-commits mailing list