r355365 - [clang-format][docs][NFC] Fix example for Allman brace breaking style
Jan Korous via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 4 17:45:31 PST 2019
Author: jkorous
Date: Mon Mar 4 17:45:31 2019
New Revision: 355365
URL: http://llvm.org/viewvc/llvm-project?rev=355365&view=rev
Log:
[clang-format][docs][NFC] Fix example for Allman brace breaking style
I assume the example is wrong as it's clearly missing line-breaks before
braces.
I just ran the example through clang-format with .clang-format like
this:
BreakBeforeBraces: Allman
Differential Revision: https://reviews.llvm.org/D58941
Modified:
cfe/trunk/docs/ClangFormatStyleOptions.rst
Modified: cfe/trunk/docs/ClangFormatStyleOptions.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ClangFormatStyleOptions.rst?rev=355365&r1=355364&r2=355365&view=diff
==============================================================================
--- cfe/trunk/docs/ClangFormatStyleOptions.rst (original)
+++ cfe/trunk/docs/ClangFormatStyleOptions.rst Mon Mar 4 17:45:31 2019
@@ -925,19 +925,28 @@ the configuration (without a prefix: ``A
.. code-block:: c++
- try {
+ try
+ {
foo();
}
- catch () {
+ catch ()
+ {
}
void foo() { bar(); }
- class foo {
+ class foo
+ {
};
- if (foo()) {
+ if (foo())
+ {
}
- else {
+ else
+ {
}
- enum X : int { A, B };
+ enum X : int
+ {
+ A,
+ B
+ };
* ``BS_GNU`` (in configuration: ``GNU``)
Always break before braces and add an extra level of indentation to
More information about the cfe-commits
mailing list