[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Jan 11 23:47:20 PST 2025
================
@@ -2252,6 +2252,25 @@ struct FormatStyle {
/// \version 16
BreakBeforeInlineASMColonStyle BreakBeforeInlineASMColon;
+ /// If ``true``, a line break will be placed before the ``>`` in a multiline
+ /// template declaration.
+ /// \code
+ /// true:
+ /// template <
+ /// typename Foo,
+ /// typename Bar,
+ /// typename Baz
+ /// >
+ ///
+ /// false:
+ /// template <
+ /// typename Foo,
+ /// typename Bar,
+ /// typename Baz>
----------------
leijurv wrote:
Would `Always` look like:
```
template<typename T
>
```
For the overall indentation / line breaking of the various typenames, I left that untouched. All that stuff went way above my head. I didn't really have an intent in mind between your described options of BlockIndent vs Multiline but yes, I suppose what I have here is Multiline.
So, should I change this from a true/false to an enum of Multiline/Never?
https://github.com/llvm/llvm-project/pull/118046
More information about the cfe-commits
mailing list