summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-08-25 13:40:51 +0000
committerDaniel Jasper <djasper@google.com>2015-08-25 13:40:51 +0000
commitaf642c692726314ae0a6cbe6466c726ed17c10c1 (patch)
tree029729e390b027b76ed4f9f45bf4aba92e517c0b /clang/lib/Format/TokenAnnotator.cpp
parent190167104cdaca2214a8dd599daf1c7c88f51415 (diff)
downloadbcm5719-llvm-af642c692726314ae0a6cbe6466c726ed17c10c1.tar.gz
bcm5719-llvm-af642c692726314ae0a6cbe6466c726ed17c10c1.zip
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
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp12
1 files changed, 6 insertions, 6 deletions
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 ||
OpenPOWER on IntegriCloud