[clang] [clang-format][docs] Clarify AllowShortFunctionsOnASingleLine deprecation (PR #195491)

via cfe-commits cfe-commits at lists.llvm.org
Sat May 2 16:08:42 PDT 2026


https://github.com/nataliakokoromyti created https://github.com/llvm/llvm-project/pull/195491

Addresses #195326. I went through the docs and I believe InlineOnly looks fine as is since it’s properly marked as deprecated. The confusing part is Inline, because it refers to both the deprecated AllowShortFunctionsOnASingleLine: Inline and the nested flag AllowShortFunctionsOnASingleLine: { Inline: true, ... } which is still valid. Making that distinction explicit in the docs might be helpful. 

>From 0d58377c6984d7a9f52054aaaf14905e5ee8e184 Mon Sep 17 00:00:00 2001
From: nataliakokoromyti <nataliakokoromyti at gmail.com>
Date: Sat, 2 May 2026 15:27:50 -0700
Subject: [PATCH] clarify inline deprecation

---
 clang/docs/ClangFormatStyleOptions.rst | 2 ++
 clang/include/clang/Format/Format.h    | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst
index fe8dfa406bc32..796172e4ad66a 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -1975,6 +1975,8 @@ the configuration (without a prefix: ``Auto``).
       Empty: false
       Inline: true
       Other: false
+  The nested ``Inline`` flag here is not deprecated. Only the scalar
+  value ``AllowShortFunctionsOnASingleLine: Inline`` is deprecated.
 
   * ``bool Empty`` Merge top-level empty functions.
 
diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h
index 6d0c508940881..d66b5466dacdc 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -893,6 +893,8 @@ struct FormatStyle {
   ///     Inline: true
   ///     Other: false
   /// \endcode
+  /// The nested ``Inline`` flag here is not deprecated. Only the scalar
+  /// value ``AllowShortFunctionsOnASingleLine: Inline`` is deprecated.
   struct ShortFunctionStyle {
     /// Merge top-level empty functions.
     /// \code



More information about the cfe-commits mailing list