IO.mapOptional("PointerBindsToType", Style.PointerBindsToType);
IO.mapOptional("SpacesBeforeTrailingComments",
Style.SpacesBeforeTrailingComments);
- IO.mapOptional("SpacesInBracedLists",
- Style.SpacesInBracedLists);
+ IO.mapOptional("SpacesInBracedLists", Style.SpacesInBracedLists);
IO.mapOptional("Standard", Style.Standard);
IO.mapOptional("IndentWidth", Style.IndentWidth);
IO.mapOptional("UseTab", Style.UseTab);
GoogleStyle.AlignEscapedNewlinesLeft = true;
GoogleStyle.AllowAllParametersOfDeclarationOnNextLine = true;
GoogleStyle.AllowShortIfStatementsOnASingleLine = true;
- GoogleStyle.AllowShortLoopsOnASingleLine= true;
+ GoogleStyle.AllowShortLoopsOnASingleLine = true;
GoogleStyle.BinPackParameters = true;
GoogleStyle.ColumnLimit = 80;
GoogleStyle.ConstructorInitializerAllOnOneLineOrOnePerLine = true;
return false; // No spaces in "{}".
if (Left.is(tok::l_brace) || Right.is(tok::r_brace))
return Style.SpacesInBracedLists;
+ if (Right.Type == TT_UnaryOperator)
+ return !Left.isOneOf(tok::l_paren, tok::l_square, tok::at) &&
+ (Left.isNot(tok::colon) || Left.Type != TT_ObjCMethodExpr);
if (Left.is(tok::identifier) && Right.is(tok::l_brace) &&
Right.getNextNoneComment())
return false;
Tok.getNextNoneComment() != NULL && Tok.Type != TT_ObjCMethodExpr;
if (Tok.Parent->Type == TT_UnaryOperator || Tok.Parent->Type == TT_CastRParen)
return false;
- if (Tok.Type == TT_UnaryOperator)
- return !Tok.Parent->isOneOf(tok::l_paren, tok::l_square, tok::at) &&
- (Tok.Parent->isNot(tok::colon) ||
- Tok.Parent->Type != TT_ObjCMethodExpr);
if (Tok.Parent->is(tok::greater) && Tok.is(tok::greater)) {
return Tok.Type == TT_TemplateCloser &&
Tok.Parent->Type == TT_TemplateCloser &&
verifyFormat("vector<int> x{1, 2, 3, 4};", NoSpaces);
verifyFormat("vector<T> x{{}, {}, {}, {}};", NoSpaces);
verifyFormat("f({1, 2});", NoSpaces);
- verifyFormat("auto v = Foo{1};", NoSpaces);
+ verifyFormat("auto v = Foo{-1};", NoSpaces);
verifyFormat("f({1, 2}, {{2, 3}, {4, 5}}, c, {d});", NoSpaces);
}