From af642c692726314ae0a6cbe6466c726ed17c10c1 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Tue, 25 Aug 2015 13:40:51 +0000 Subject: clang-format: Add space before member function reference qualifiers. Before: SomeType MemberFunction(const Deleted &)&; After: SomeType MemberFunction(const Deleted &) &; Seems to be much more common. llvm-svn: 245934 --- clang/lib/Format/TokenAnnotator.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'clang/lib/Format/TokenAnnotator.cpp') diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index ac34df2455f..5dad651bd96 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1050,7 +1050,8 @@ private: PreviousNotConst->MatchingParen->Previous->is(tok::kw_decltype)) return true; - return (!IsPPKeyword && PreviousNotConst->is(tok::identifier)) || + return (!IsPPKeyword && + PreviousNotConst->isOneOf(tok::identifier, tok::kw_auto)) || PreviousNotConst->is(TT_PointerOrReference) || PreviousNotConst->isSimpleTypeSpecifier(); } @@ -1842,11 +1843,10 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line, if (Left.is(tok::l_square) && Right.is(tok::amp)) return false; if (Right.is(TT_PointerOrReference)) - return !(Left.is(tok::r_paren) && Left.MatchingParen && - (Left.MatchingParen->is(TT_OverloadedOperatorLParen) || - (Left.MatchingParen->Previous && - Left.MatchingParen->Previous->is( - TT_FunctionDeclarationName)))) && + return (Left.is(tok::r_paren) && Left.MatchingParen && + (Left.MatchingParen->is(TT_OverloadedOperatorLParen) || + (Left.MatchingParen->Previous && + Left.MatchingParen->Previous->is(TT_FunctionDeclarationName)))) || (Left.Tok.isLiteral() || (!Left.isOneOf(TT_PointerOrReference, tok::l_paren) && (Style.PointerAlignment != FormatStyle::PAS_Left || -- cgit v1.2.3