diff options
author | Alexander Kornienko <alexfh@google.com> | 2013-12-16 14:35:51 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2013-12-16 14:35:51 +0000 |
commit | a594ba8a76c75c0ec293cfae028bd45c093bae2c (patch) | |
tree | 538b8d36d35776c61945a02a70ba3d1adf61e27e /clang/lib/Format/TokenAnnotator.cpp | |
parent | e8323a88ea252a0b16f2d54a129cfc8ac7ab744c (diff) | |
download | bcm5719-llvm-a594ba8a76c75c0ec293cfae028bd45c093bae2c.tar.gz bcm5719-llvm-a594ba8a76c75c0ec293cfae028bd45c093bae2c.zip |
Always break before the colon in constructor initializers, when
BreakConstructorInitializersBeforeComma is true.
This option is used in WebKit style, so this also ensures initializer lists are
not put on a single line, as per the WebKit coding guidelines.
Patch by Florian Sowade!
llvm-svn: 197386
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 19759afc854..e2615dbb6a2 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1407,7 +1407,8 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, Right.Previous->MatchingParen->NestingLevel == 0 && Style.AlwaysBreakTemplateDeclarations) { return true; - } else if (Right.Type == TT_CtorInitializerComma && + } else if ((Right.Type == TT_CtorInitializerComma || + Right.Type == TT_CtorInitializerColon) && Style.BreakConstructorInitializersBeforeComma && !Style.ConstructorInitializerAllOnOneLineOrOnePerLine) { return true; |