jkorous created this revision.
jkorous added reviewers: JDevlieghere, krasimir, benhamilton.
Herald added subscribers: cfe-commits, dexonsmith.
Herald added a project: clang.
I assume the example is wrong as it's clearly missing line-breaks before
braces. That's about my level of understanding and I am totally oblivious to
any finer details.
I just ran the example through clang-format with .clang-format like this:
BreakBeforeBraces: Allman
Repository:
rC Clang
https://reviews.llvm.org/D58941
Files:
clang/docs/ClangFormatStyleOptions.rst
Index: clang/docs/ClangFormatStyleOptions.rst
===================================================================
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -925,19 +925,28 @@
.. 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
Index: clang/docs/ClangFormatStyleOptions.rst
===================================================================
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -925,19 +925,28 @@
.. 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
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits