diff options
author | Sylvestre Ledru <sylvestre@debian.org> | 2018-10-26 07:25:37 +0000 |
---|---|---|
committer | Sylvestre Ledru <sylvestre@debian.org> | 2018-10-26 07:25:37 +0000 |
commit | a060aa8a982f1a7f4b78aeb0593e69890bce80f0 (patch) | |
tree | 1412da908ec511738296258f11d4f02eb69b93f9 | |
parent | cbd73574e43e0b14f428cbe7f748c5bba8636e3a (diff) | |
download | bcm5719-llvm-a060aa8a982f1a7f4b78aeb0593e69890bce80f0.tar.gz bcm5719-llvm-a060aa8a982f1a7f4b78aeb0593e69890bce80f0.zip |
Update the example of BS_Stroustrup to match what is done by clang-format
Summary:
reported here https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911561
clang-format-7 -style="{BreakBeforeBraces: Stroustrup}" wasn't doing
the same as the doc
Reviewers: krasimir
Reviewed By: krasimir
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D53520
llvm-svn: 345371
-rw-r--r-- | clang/docs/ClangFormatStyleOptions.rst | 15 | ||||
-rw-r--r-- | clang/include/clang/Format/Format.h | 15 |
2 files changed, 12 insertions, 18 deletions
diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst index d50c883dbd9..6b7c578317b 100644 --- a/clang/docs/ClangFormatStyleOptions.rst +++ b/clang/docs/ClangFormatStyleOptions.rst @@ -908,20 +908,17 @@ the configuration (without a prefix: ``Auto``). try { foo(); - } catch () { + } + catch () { } void foo() { bar(); } - class foo - { + class foo { }; if (foo()) { - } else { } - enum X : int - { - A, - B - }; + else { + } + enum X : int { A, B }; * ``BS_Allman`` (in configuration: ``Allman``) Always break before braces. diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h index b777496eb19..cb37b0c890c 100644 --- a/clang/include/clang/Format/Format.h +++ b/clang/include/clang/Format/Format.h @@ -533,20 +533,17 @@ struct FormatStyle { /// \code /// try { /// foo(); - /// } catch () { + /// } + /// catch () { /// } /// void foo() { bar(); } - /// class foo - /// { + /// class foo { /// }; /// if (foo()) { - /// } else { /// } - /// enum X : int - /// { - /// A, - /// B - /// }; + /// else { + /// } + /// enum X : int { A, B }; /// \endcode BS_Stroustrup, /// Always break before braces. |