aboutsummaryrefslogtreecommitdiff
path: root/clang/docs/ClangFormatStyleOptions.rst
diff options
context:
space:
mode:
authorOwen Pan <owenpiano@gmail.com>2023-11-09 23:01:48 -0800
committerGitHub <noreply@github.com>2023-11-09 23:01:48 -0800
commit5c36f4332d93c6f9bd9b01a34149a635e07a00d3 (patch)
treef0605ef8b8800f816791d6e7fd4aa40e30a2a1f8 /clang/docs/ClangFormatStyleOptions.rst
parentfdbff88196b54cea12deb1fae978277066dffd1e (diff)
downloadllvm-5c36f4332d93c6f9bd9b01a34149a635e07a00d3.zip
llvm-5c36f4332d93c6f9bd9b01a34149a635e07a00d3.tar.gz
llvm-5c36f4332d93c6f9bd9b01a34149a635e07a00d3.tar.bz2
[clang-format] Handle variable declarations in BreakAfterAttributes (#71755)
Also cleaned up some old test cases. Fixes #71563.
Diffstat (limited to 'clang/docs/ClangFormatStyleOptions.rst')
-rw-r--r--clang/docs/ClangFormatStyleOptions.rst13
1 files changed, 11 insertions, 2 deletions
diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst
index 21342e1..d496fc8 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -2049,8 +2049,8 @@ the configuration (without a prefix: ``Auto``).
.. _BreakAfterAttributes:
**BreakAfterAttributes** (``AttributeBreakingStyle``) :versionbadge:`clang-format 16` :ref:`ΒΆ <BreakAfterAttributes>`
- Break after a group of C++11 attributes before a function
- declaration/definition name.
+ Break after a group of C++11 attributes before a variable/function
+ (including constructor/destructor) declaration/definition name.
Possible values:
@@ -2059,6 +2059,10 @@ the configuration (without a prefix: ``Auto``).
.. code-block:: c++
+ [[maybe_unused]]
+ const int i;
+ [[gnu::const]] [[maybe_unused]]
+ int j;
[[nodiscard]]
inline int f();
[[gnu::const]] [[nodiscard]]
@@ -2069,6 +2073,9 @@ the configuration (without a prefix: ``Auto``).
.. code-block:: c++
+ [[maybe_unused]] const int i;
+ [[gnu::const]] [[maybe_unused]]
+ int j;
[[nodiscard]] inline int f();
[[gnu::const]] [[nodiscard]]
int g();
@@ -2078,6 +2085,8 @@ the configuration (without a prefix: ``Auto``).
.. code-block:: c++
+ [[maybe_unused]] const int i;
+ [[gnu::const]] [[maybe_unused]] int j;
[[nodiscard]] inline int f();
[[gnu::const]] [[nodiscard]] int g();