[cfe-dev] clang-format: Proposal for a new style for constructor and initializers line break.

Jean-philippe Dufraigne j.dufraigne at gmail.com
Sun Sep 14 01:34:12 PDT 2014


Hello,

I'm interested in adding support for another style for constructor colon
and initializer.
An example of the style is above the value BCIS_AfterColonAndComma bellow.

BreakConstructorInitializers would replace 'bool
BreakConstructorInitializersBeforeComma;' while maintaining backward
compatibility, in a similar fashion it was done before.

I have the prototype for the code and would be really happy to finalize it
and contribute a set of small patches.

Please let me know if this something that fits with the project and if you
have any advice.
Best Regards,
Jean-Philippe

  /// \brief Different ways to break initializers.
  enum BreakConstructorInitializersStyle
  {
    /// Constructor()
    ///     : initializer1(),
    ///       initializer2()
    BCIS_BeforeColonAfterComma,
    /// Constructor()
    ///     : initializer1()
    ///     , initializer2()
    BCIS_BeforeColonAndComma,
    /// Constructor() :
    ///     initializer1(),
    ///     initializer2()
    BCIS_AfterColonAndComma
  };

  /// \brief Breaking and alignment style for constructor initializers
  BreakConstructorInitializersStyle BreakConstructorInitializers;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140914/004e7985/attachment.html>


More information about the cfe-dev mailing list