[clang] [clang-format] Allow custom pointer/ref alignment in return types (PR #169160)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 22 06:46:10 PST 2025


================
@@ -4017,6 +4017,27 @@ struct FormatStyle {
   /// \version 3.7
   unsigned PenaltyReturnTypeOnItsOwnLine;
 
+  /// \brief The pointer/reference alignment style for specialized cases.
+  enum SpecializedAlignmentStyle : int8_t {
+    /// Use default alignment.
+    SAS_Default,
+    /// Align pointer/reference to the left.
+    /// \code
+    ///   int* a(void);
+    /// \endcode
+    SAS_Left,
+    /// Align pointer/reference to the right.
+    /// \code
+    ///   int * a(void);
+    /// \endcode
+    SAS_Right,
+    /// Align pointer/reference in the middle.
+    /// \code
+    ///   int *a(void);
----------------
HazardyKnusperkeks wrote:

You mixed up the examples.

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


More information about the cfe-commits mailing list