Skip to content

Commit

Permalink
[clang-format][docs][NFC] Fix example for Allman brace breaking style
Browse files Browse the repository at this point in the history
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

llvm-svn: 355365
  • Loading branch information
jkorous-apple committed Mar 5, 2019
1 parent 814ad73 commit 3fd4a96
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions clang/docs/ClangFormatStyleOptions.rst
Expand Up @@ -925,19 +925,28 @@ the configuration (without a prefix: ``Auto``).

.. 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
Expand Down

0 comments on commit 3fd4a96

Please sign in to comment.