summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-04-23 12:59:09 +0000
committerDaniel Jasper <djasper@google.com>2015-04-23 12:59:09 +0000
commitcaf84fe21eb9ac60b7dbbc49bce41c9cee0c6609 (patch)
tree72062e3c8ba13ad66258e213933b3b514215f62a /clang/lib/Format
parentd0be0a989714dcef56f8d7bd977d16fb43050330 (diff)
downloadbcm5719-llvm-caf84fe21eb9ac60b7dbbc49bce41c9cee0c6609.tar.gz
bcm5719-llvm-caf84fe21eb9ac60b7dbbc49bce41c9cee0c6609.zip
clang-format: Allow splitting "= default" and "= delete".
Otherwise, this can violate the column limit. llvm-svn: 235592
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 60344021c58..c6ffd8a9778 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -2063,7 +2063,8 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line,
if (Left.isOneOf(TT_TemplateCloser, TT_UnaryOperator) ||
Left.is(tok::kw_operator))
return false;
- if (Left.is(tok::equal) && Line.Type == LT_VirtualFunctionDecl)
+ if (Left.is(tok::equal) && !Right.isOneOf(tok::kw_default, tok::kw_delete) &&
+ Line.Type == LT_VirtualFunctionDecl)
return false;
if (Left.is(tok::l_paren) && Left.is(TT_AttributeParen))
return false;
OpenPOWER on IntegriCloud