[clang] [clang-format] Fix parsing of `operator<() {}` (PR #75144)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 12 22:02:50 PST 2023


================
@@ -11727,6 +11727,13 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
                "  void func(type &a) { a & member; }\n"
                "  anotherType &member;\n"
                "}");
+
+  Style.ReferenceAlignment = FormatStyle::RAS_Left;
+  verifyFormat("class Foo {\n"
+               "  void operator<(Foo&) {}\n"
+               "  Foo& f;\n"
+               "};",
+               Style);
----------------
owenca wrote:

Consider remove this test. The one in `UnderstandsUsesOfStarAndAmp` of `UnderstandsUsesOfStarAndAmp` is enough.

https://github.com/llvm/llvm-project/pull/75144


More information about the cfe-commits mailing list