diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2014-03-02 12:37:31 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2014-03-02 12:37:31 +0000 |
| commit | 99aa2bfed56557805230cb81e1b41008591cc29c (patch) | |
| tree | b6028170bddbc4562dd717c20e86fc8803c85cc9 /lib/Format/Format.cpp | |
| parent | 1824794b41bbf858f582656ace9e649753f33ccf (diff) | |
| download | clang-99aa2bfed56557805230cb81e1b41008591cc29c.tar.gz clang-99aa2bfed56557805230cb81e1b41008591cc29c.tar.bz2 clang-99aa2bfed56557805230cb81e1b41008591cc29c.tar.xz | |
[C++11] Switch the clang-format LLVM style to use C++11 style braced
init list formatting. This suggestion has now gone into the LLVM coding
standards, and is particularly relevant now that we're using C++11.
Updated a really ridiculous number of tests to reflect this change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202637 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
| -rw-r--r-- | lib/Format/Format.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 7e79b05506..79bf101252 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -259,7 +259,7 @@ FormatStyle getLLVMStyle() { LLVMStyle.ColumnLimit = 80; LLVMStyle.ConstructorInitializerAllOnOneLineOrOnePerLine = false; LLVMStyle.ConstructorInitializerIndentWidth = 4; - LLVMStyle.Cpp11BracedListStyle = false; + LLVMStyle.Cpp11BracedListStyle = true; LLVMStyle.DerivePointerBinding = false; LLVMStyle.ExperimentalAutoDetectBinPacking = false; LLVMStyle.IndentCaseLabels = false; @@ -272,7 +272,7 @@ FormatStyle getLLVMStyle() { LLVMStyle.ObjCSpaceBeforeProtocolList = true; LLVMStyle.PointerBindsToType = false; LLVMStyle.SpacesBeforeTrailingComments = 1; - LLVMStyle.Standard = FormatStyle::LS_Cpp03; + LLVMStyle.Standard = FormatStyle::LS_Cpp11; LLVMStyle.UseTab = FormatStyle::UT_Never; LLVMStyle.SpacesInParentheses = false; LLVMStyle.SpaceInEmptyParentheses = false; @@ -305,7 +305,6 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) { GoogleStyle.AlwaysBreakBeforeMultilineStrings = true; GoogleStyle.AlwaysBreakTemplateDeclarations = true; GoogleStyle.ConstructorInitializerAllOnOneLineOrOnePerLine = true; - GoogleStyle.Cpp11BracedListStyle = true; GoogleStyle.DerivePointerBinding = true; GoogleStyle.IndentCaseLabels = true; GoogleStyle.IndentFunctionDeclarationAfterType = true; @@ -343,6 +342,7 @@ FormatStyle getChromiumStyle(FormatStyle::LanguageKind Language) { FormatStyle getMozillaStyle() { FormatStyle MozillaStyle = getLLVMStyle(); MozillaStyle.AllowAllParametersOfDeclarationOnNextLine = false; + MozillaStyle.Cpp11BracedListStyle = false; MozillaStyle.ConstructorInitializerAllOnOneLineOrOnePerLine = true; MozillaStyle.DerivePointerBinding = true; MozillaStyle.IndentCaseLabels = true; @@ -350,6 +350,7 @@ FormatStyle getMozillaStyle() { MozillaStyle.ObjCSpaceBeforeProtocolList = false; MozillaStyle.PenaltyReturnTypeOnItsOwnLine = 200; MozillaStyle.PointerBindsToType = true; + MozillaStyle.Standard = FormatStyle::LS_Cpp03; return MozillaStyle; } @@ -360,11 +361,13 @@ FormatStyle getWebKitStyle() { Style.BreakBeforeBinaryOperators = true; Style.BreakBeforeBraces = FormatStyle::BS_Stroustrup; Style.BreakConstructorInitializersBeforeComma = true; + Style.Cpp11BracedListStyle = false; Style.ColumnLimit = 0; Style.IndentWidth = 4; Style.NamespaceIndentation = FormatStyle::NI_Inner; Style.ObjCSpaceAfterProperty = true; Style.PointerBindsToType = true; + Style.Standard = FormatStyle::LS_Cpp03; return Style; } @@ -373,8 +376,10 @@ FormatStyle getGNUStyle() { Style.BreakBeforeBinaryOperators = true; Style.BreakBeforeBraces = FormatStyle::BS_GNU; Style.BreakBeforeTernaryOperators = true; + Style.Cpp11BracedListStyle = false; Style.ColumnLimit = 79; Style.SpaceBeforeParens = FormatStyle::SBPO_Always; + Style.Standard = FormatStyle::LS_Cpp03; return Style; } |
