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

via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 24 23:20:24 PST 2025


================
@@ -4036,9 +4036,78 @@ struct FormatStyle {
     PAS_Middle
   };
 
+  /// \brief The pointer/reference alignment style for function return types.
+  enum ReturnTypeAlignmentStyle : int8_t {
+    /// Use default alignment.
+    RTAS_Default,
+    /// Align pointer/reference to the left.
+    /// \code
+    ///   int* a(void);
+    /// \endcode
+    RTAS_Left,
+    /// Align pointer/reference to the right.
+    /// \code
+    ///   int *a(void);
+    /// \endcode
+    RTAS_Right,
+    /// Align pointer/reference in the middle.
+    /// \code
+    ///   int * a(void);
+    /// \endcode
+    RTAS_Middle
+  };
+
+  /// \brief The pointer/reference alignment style for C-style casts.
+  enum CastAlignmentStyle : int8_t {
----------------
mydeveloperday wrote:

C before R

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


More information about the cfe-commits mailing list