[clang] [clang-format][docs] Clarify AllowShortFunctionsOnASingleLine deprecation (PR #195491)
Björn Schäpers via cfe-commits
cfe-commits at lists.llvm.org
Sun May 3 05:41:46 PDT 2026
https://github.com/HazardyKnusperkeks updated https://github.com/llvm/llvm-project/pull/195491
>From f31a24b8a82c4f636770343dd42861373ad4c2a7 Mon Sep 17 00:00:00 2001
From: nataliakokoromyti <nataliakokoromyti at gmail.com>
Date: Sat, 2 May 2026 23:59:28 -0700
Subject: [PATCH 1/2] clarify inline deprecation
---
clang/docs/ClangFormatStyleOptions.rst | 12 ++++--------
clang/include/clang/Format/Format.h | 13 +++++--------
2 files changed, 9 insertions(+), 16 deletions(-)
diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst
index fe8dfa406bc32..d492f2364cf74 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -1912,8 +1912,7 @@ the configuration (without a prefix: ``Auto``).
* ``InlineOnly``
Only merge functions defined inside a class. Same as ``inline``,
except it does not implies ``empty``: i.e. top level empty functions
- are not merged either. This option is **deprecated** and is retained
- for backwards compatibility. See ``Inline`` of ``ShortFunctionStyle``.
+ are not merged either. See ``Inline`` of ``ShortFunctionStyle``.
.. code-block:: c++
@@ -1927,9 +1926,7 @@ the configuration (without a prefix: ``Auto``).
}
* ``Empty``
- Only merge empty functions. This option is **deprecated** and is
- retained for backwards compatibility. See ``Empty`` of
- ``ShortFunctionStyle``.
+ Only merge empty functions. See ``Empty`` of ``ShortFunctionStyle``.
.. code-block:: c++
@@ -1939,9 +1936,8 @@ the configuration (without a prefix: ``Auto``).
}
* ``Inline``
- Only merge functions defined inside a class. Implies ``empty``. This
- option is **deprecated** and is retained for backwards compatibility.
- See ``Inline`` and ``Empty`` of ``ShortFunctionStyle``.
+ Only merge functions defined inside a class. Implies ``empty``. See
+ ``Inline`` and ``Empty`` of ``ShortFunctionStyle``.
.. code-block:: c++
diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h
index 6d0c508940881..511c6f39f008a 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -835,8 +835,7 @@ struct FormatStyle {
/// * ``InlineOnly``
/// Only merge functions defined inside a class. Same as ``inline``,
/// except it does not implies ``empty``: i.e. top level empty functions
- /// are not merged either. This option is **deprecated** and is retained
- /// for backwards compatibility. See ``Inline`` of ``ShortFunctionStyle``.
+ /// are not merged either. See ``Inline`` of ``ShortFunctionStyle``.
/// \code
/// class Foo {
/// void f() { foo(); }
@@ -849,9 +848,7 @@ struct FormatStyle {
/// \endcode
///
/// * ``Empty``
- /// Only merge empty functions. This option is **deprecated** and is
- /// retained for backwards compatibility. See ``Empty`` of
- /// ``ShortFunctionStyle``.
+ /// Only merge empty functions. See ``Empty`` of ``ShortFunctionStyle``.
/// \code
/// void f() {}
/// void f2() {
@@ -860,9 +857,8 @@ struct FormatStyle {
/// \endcode
///
/// * ``Inline``
- /// Only merge functions defined inside a class. Implies ``empty``. This
- /// option is **deprecated** and is retained for backwards compatibility.
- /// See ``Inline`` and ``Empty`` of ``ShortFunctionStyle``.
+ /// Only merge functions defined inside a class. Implies ``empty``. See
+ /// ``Inline`` and ``Empty`` of ``ShortFunctionStyle``.
/// \code
/// class Foo {
/// void f() { foo(); }
@@ -893,6 +889,7 @@ struct FormatStyle {
/// Inline: true
/// Other: false
/// \endcode
+ ///
struct ShortFunctionStyle {
/// Merge top-level empty functions.
/// \code
>From ea7560c895c71fc5bd78373356c4d4fb919ac22c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?= <github at hazardy.de>
Date: Sun, 3 May 2026 14:41:38 +0200
Subject: [PATCH 2/2] Update clang/include/clang/Format/Format.h
---
clang/include/clang/Format/Format.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h
index 511c6f39f008a..98400a1609b6a 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -889,7 +889,6 @@ struct FormatStyle {
/// Inline: true
/// Other: false
/// \endcode
- ///
struct ShortFunctionStyle {
/// Merge top-level empty functions.
/// \code
More information about the cfe-commits
mailing list