Index: clang/lib/Format/Format.cpp =================================================================== --- clang/lib/Format/Format.cpp +++ clang/lib/Format/Format.cpp @@ -726,24 +726,25 @@ if (Style.BreakBeforeBraces == FormatStyle::BS_Custom) return Style; FormatStyle Expanded = Style; - Expanded.BraceWrapping = {/*AfterCaseLabel=*/false, - /*AfterClass=*/false, - /*AfterControlStatement=*/FormatStyle::BWACS_Never, - /*AfterEnum=*/false, - /*AfterFunction=*/false, - /*AfterNamespace=*/false, - /*AfterObjCDeclaration=*/false, - /*AfterStruct=*/false, - /*AfterUnion=*/false, - /*AfterExternBlock=*/false, - /*BeforeCatch=*/false, - /*BeforeElse=*/false, - /*BeforeLambdaBody=*/false, - /*BeforeWhile=*/false, - /*IndentBraces=*/false, - /*SplitEmptyFunction=*/true, - /*SplitEmptyRecord=*/true, - /*SplitEmptyNamespace=*/true}; + Expanded.BraceWrapping.AfterCaseLabel = false; + Expanded.BraceWrapping.AfterClass = false; + Expanded.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Never; + Expanded.BraceWrapping.AfterEnum = false; + Expanded.BraceWrapping.AfterFunction = false; + Expanded.BraceWrapping.AfterNamespace = false; + Expanded.BraceWrapping.AfterObjCDeclaration = false; + Expanded.BraceWrapping.AfterStruct = false; + Expanded.BraceWrapping.AfterUnion = false; + Expanded.BraceWrapping.AfterExternBlock = false; + Expanded.BraceWrapping.BeforeCatch = false; + Expanded.BraceWrapping.BeforeElse = false; + Expanded.BraceWrapping.BeforeLambdaBody = false; + Expanded.BraceWrapping.BeforeWhile = false; + Expanded.BraceWrapping.IndentBraces = false; + Expanded.BraceWrapping.SplitEmptyFunction = true; + Expanded.BraceWrapping.SplitEmptyRecord = true; + Expanded.BraceWrapping.SplitEmptyNamespace = true; + Expanded.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock; switch (Style.BreakBeforeBraces) { case FormatStyle::BS_Linux: Expanded.BraceWrapping.AfterClass = true; @@ -797,25 +798,24 @@ Expanded.BraceWrapping.BeforeLambdaBody = true; break; case FormatStyle::BS_GNU: - Expanded.BraceWrapping = { - /*AfterCaseLabel=*/true, - /*AfterClass=*/true, - /*AfterControlStatement=*/FormatStyle::BWACS_Always, - /*AfterEnum=*/true, - /*AfterFunction=*/true, - /*AfterNamespace=*/true, - /*AfterObjCDeclaration=*/true, - /*AfterStruct=*/true, - /*AfterUnion=*/true, - /*AfterExternBlock=*/true, - /*BeforeCatch=*/true, - /*BeforeElse=*/true, - /*BeforeLambdaBody=*/false, - /*BeforeWhile=*/true, - /*IndentBraces=*/true, - /*SplitEmptyFunction=*/true, - /*SplitEmptyRecord=*/true, - /*SplitEmptyNamespace=*/true}; + Expanded.BraceWrapping.AfterCaseLabel = true; + Expanded.BraceWrapping.AfterClass = true; + Expanded.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always; + Expanded.BraceWrapping.AfterEnum = true; + Expanded.BraceWrapping.AfterFunction = true; + Expanded.BraceWrapping.AfterNamespace = true; + Expanded.BraceWrapping.AfterObjCDeclaration = true; + Expanded.BraceWrapping.AfterStruct = true; + Expanded.BraceWrapping.AfterUnion = true; + Expanded.BraceWrapping.AfterExternBlock = true; + Expanded.BraceWrapping.BeforeCatch = true; + Expanded.BraceWrapping.BeforeElse = true; + Expanded.BraceWrapping.BeforeLambdaBody = false; + Expanded.BraceWrapping.BeforeWhile = true; + Expanded.BraceWrapping.IndentBraces = true; + Expanded.BraceWrapping.SplitEmptyFunction = true; + Expanded.BraceWrapping.SplitEmptyRecord = true; + Expanded.BraceWrapping.SplitEmptyNamespace = true; Expanded.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock; break; case FormatStyle::BS_WebKit: @@ -859,24 +859,24 @@ LLVMStyle.BreakBeforeBinaryOperators = FormatStyle::BOS_None; LLVMStyle.BreakBeforeTernaryOperators = true; LLVMStyle.BreakBeforeBraces = FormatStyle::BS_Attach; - LLVMStyle.BraceWrapping = {/*AfterCaseLabel=*/false, - /*AfterClass=*/false, - /*AfterControlStatement=*/FormatStyle::BWACS_Never, - /*AfterEnum=*/false, - /*AfterFunction=*/false, - /*AfterNamespace=*/false, - /*AfterObjCDeclaration=*/false, - /*AfterStruct=*/false, - /*AfterUnion=*/false, - /*AfterExternBlock=*/false, - /*BeforeCatch=*/false, - /*BeforeElse=*/false, - /*BeforeLambdaBody=*/false, - /*BeforeWhile=*/false, - /*IndentBraces=*/false, - /*SplitEmptyFunction=*/true, - /*SplitEmptyRecord=*/true, - /*SplitEmptyNamespace=*/true}; + LLVMStyle.BraceWrapping.AfterCaseLabel = false; + LLVMStyle.BraceWrapping.AfterClass = false; + LLVMStyle.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Never; + LLVMStyle.BraceWrapping.AfterEnum = false; + LLVMStyle.BraceWrapping.AfterFunction = false; + LLVMStyle.BraceWrapping.AfterNamespace = false; + LLVMStyle.BraceWrapping.AfterObjCDeclaration = false; + LLVMStyle.BraceWrapping.AfterStruct = false; + LLVMStyle.BraceWrapping.AfterUnion = false; + LLVMStyle.BraceWrapping.AfterExternBlock = false; + LLVMStyle.BraceWrapping.BeforeCatch = false; + LLVMStyle.BraceWrapping.BeforeElse = false; + LLVMStyle.BraceWrapping.BeforeLambdaBody = false; + LLVMStyle.BraceWrapping.BeforeWhile = false; + LLVMStyle.BraceWrapping.IndentBraces = false; + LLVMStyle.BraceWrapping.SplitEmptyFunction = true; + LLVMStyle.BraceWrapping.SplitEmptyRecord = true; + LLVMStyle.BraceWrapping.SplitEmptyNamespace = true; LLVMStyle.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock; LLVMStyle.BreakAfterJavaFieldAnnotations = false; LLVMStyle.BreakConstructorInitializers = FormatStyle::BCIS_BeforeColon;