[PATCH] D104096: [Clang-Format] Add ReferenceAlignment directive

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 11 12:04:51 PDT 2021


HazardyKnusperkeks added a comment.

Can you also add tests with the alignment of declarations? We already have such for pointers.



================
Comment at: clang/include/clang/Format/Format.h:2706
+  /// references).
+  ReferenceAlignmentStyle ReferenceAlignment;
+
----------------
Please move below the RawStringFormats, same for the comparison etc.


================
Comment at: clang/unittests/Format/FormatTest.cpp:1243-1244
+  verifyFormat("int *f1(int &a) const & = 0;", Style);
+  verifyFormat("int *a = f1();\nint &b = f2();\nint &&c = f3();", Style);
+  Style.PointerAlignment = FormatStyle::PAS_Left;
+  Style.ReferenceAlignment = FormatStyle::RAS_Pointer;
----------------
MyDeveloperDay wrote:
> could you put each line on its own line. makes it easier to reason about
Please also add the empty line.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104096



More information about the cfe-commits mailing list