summaryrefslogtreecommitdiff
path: root/include/clang/Format/Format.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Format/Format.h')
-rw-r--r--include/clang/Format/Format.h42
1 files changed, 30 insertions, 12 deletions
diff --git a/include/clang/Format/Format.h b/include/clang/Format/Format.h
index 2405f8319c61..7ec3e22ca4d7 100644
--- a/include/clang/Format/Format.h
+++ b/include/clang/Format/Format.h
@@ -710,16 +710,35 @@ struct FormatStyle {
/// \endcode
bool BreakBeforeTernaryOperators;
- /// \brief Always break constructor initializers before commas and align
- /// the commas with the colon.
- /// \code
- /// true: false:
- /// SomeClass::Constructor() vs. SomeClass::Constructor() : a(a),
- /// : a(a) b(b),
- /// , b(b) c(c) {}
- /// , c(c) {}
- /// \endcode
- bool BreakConstructorInitializersBeforeComma;
+ /// \brief Different ways to break initializers.
+ enum BreakConstructorInitializersStyle
+ {
+ /// Break constructor initializers before the colon and after the commas.
+ /// \code
+ /// Constructor()
+ /// : initializer1(),
+ /// initializer2()
+ /// \endcode
+ BCIS_BeforeColon,
+ /// Break constructor initializers before the colon and commas, and align
+ /// the commas with the colon.
+ /// \code
+ /// Constructor()
+ /// : initializer1()
+ /// , initializer2()
+ /// \endcode
+ BCIS_BeforeComma,
+ /// Break constructor initializers after the colon and commas.
+ /// \code
+ /// Constructor() :
+ /// initializer1(),
+ /// initializer2()
+ /// \endcode
+ BCIS_AfterColon
+ };
+
+ /// \brief The constructor initializers style to use..
+ BreakConstructorInitializersStyle BreakConstructorInitializers;
/// \brief Break after each annotation on a field in Java files.
/// \code{.java}
@@ -1390,8 +1409,7 @@ struct FormatStyle {
BreakBeforeBinaryOperators == R.BreakBeforeBinaryOperators &&
BreakBeforeBraces == R.BreakBeforeBraces &&
BreakBeforeTernaryOperators == R.BreakBeforeTernaryOperators &&
- BreakConstructorInitializersBeforeComma ==
- R.BreakConstructorInitializersBeforeComma &&
+ BreakConstructorInitializers == R.BreakConstructorInitializers &&
BreakAfterJavaFieldAnnotations == R.BreakAfterJavaFieldAnnotations &&
BreakStringLiterals == R.BreakStringLiterals &&
ColumnLimit == R.ColumnLimit && CommentPragmas == R.CommentPragmas &&