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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355365
91177308-0d34-0410-b5e6-
96231b3b80d8
.. 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