summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2016-06-13 07:49:28 +0000
committerDaniel Jasper <djasper@google.com>2016-06-13 07:49:28 +0000
commit43e4d3a05be7e797045e36091ab354face31800f (patch)
tree616a5826c94cfd3396c06cd230cf4c8189b088d3 /clang/lib/Format
parent594be2f03705f0beeefd6991045bbd2f793558a1 (diff)
downloadbcm5719-llvm-43e4d3a05be7e797045e36091ab354face31800f.tar.gz
bcm5719-llvm-43e4d3a05be7e797045e36091ab354face31800f.zip
clang-format: Don't merge const and &, e.g. in function ref qualifiers.
Before (when aligning & to the right): SomeType MemberFunction(const Deleted &) const&; After: SomeType MemberFunction(const Deleted &) const &; This also applies to variable declarations, e.g.: int const * a; However, this form is very uncommon (most people would write "const int* a" instead) and contracting to "const*" might actually send the wrong signal of what the const binds to. llvm-svn: 272537
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 1f1a32a2b2c..8a36aca97e5 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1993,7 +1993,7 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
return false;
if (Right.is(TT_PointerOrReference))
return (Left.is(tok::r_paren) && Line.MightBeFunctionDecl) ||
- (Left.Tok.isLiteral() ||
+ (Left.Tok.isLiteral() || Left.is(tok::kw_const) ||
(!Left.isOneOf(TT_PointerOrReference, tok::l_paren) &&
(Style.PointerAlignment != FormatStyle::PAS_Left ||
Line.IsMultiVariableDeclStmt)));
OpenPOWER on IntegriCloud