[clang] [clang-format][docs] Clarify AllowShortFunctionsOnASingleLine deprecation (PR #195491)
via cfe-commits
cfe-commits at lists.llvm.org
Sat May 2 16:09:15 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang-format
Author: nataliakokoromyti
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/195491.diff
2 Files Affected:
- (modified) clang/docs/ClangFormatStyleOptions.rst (+2)
- (modified) clang/include/clang/Format/Format.h (+2)
``````````diff
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
``````````
</details>
https://github.com/llvm/llvm-project/pull/195491
More information about the cfe-commits
mailing list