Sean Silva
2013-Jun-26 18:29 UTC
[LLVMdev] clang-format: `AlwaysBreakTemplateDeclarations: true` for LLVMStyle?
Hi guys, Is the current setting of `AlwaysBreakTemplateDeclarations: false` for LLVMStyle intentional? What was the rationale? Some rough counts on the LLVM codebase: same-line: $ git grep -E 'template.*(class|struct).*{' -- '*.h' '*.cpp' | wc -l 214 (most of them are tiny traits classes, like isPodLike or DenseMapInfo) not-same-line: $ git grep -A1 -h 'template' -- '*.h' '*.cpp' | egrep '^\s*(class|struct).*{' | wc -l 622 Recently, when using clang-format I've had to manually go back and change cases where clang-format does not put the `template <...>` on its own line. I know that I could write a local .clang-format for this, but I think it should be in the LLVMStyle to begin with (barring this choice being intentional and having a reasonable rationale). -- Sean Silva -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130626/c131844d/attachment.html>
Daniel Jasper
2013-Jun-30 15:22 UTC
[LLVMdev] clang-format: `AlwaysBreakTemplateDeclarations: true` for LLVMStyle?
The rationale is that we introduced this option (before it was always 'false') and we did not know what the desired behavior for LLVM style is. Thus, we opted for not changing clang-format's behavior. Your numbers show to some extend that other developers are also not clear on this (3:1 is far from a clear decision). Note, that some of the 622 not-same-line-cases might in theory be due to line length making the gap even smaller (I have not double-checked that, though). Feel free to change this flag, but I suggest getting the opinions of a few key contributors first. On Wed, Jun 26, 2013 at 8:29 PM, Sean Silva <silvas at purdue.edu> wrote:> Hi guys, > > Is the current setting of `AlwaysBreakTemplateDeclarations: false` for > LLVMStyle intentional? What was the rationale? > > Some rough counts on the LLVM codebase: > > same-line: > $ git grep -E 'template.*(class|struct).*{' -- '*.h' '*.cpp' | wc -l > 214 > > (most of them are tiny traits classes, like isPodLike or DenseMapInfo) > > not-same-line: > $ git grep -A1 -h 'template' -- '*.h' '*.cpp' | egrep > '^\s*(class|struct).*{' | wc -l > 622 > > Recently, when using clang-format I've had to manually go back and change > cases where clang-format does not put the `template <...>` on its own line. > I know that I could write a local .clang-format for this, but I think it > should be in the LLVMStyle to begin with (barring this choice being > intentional and having a reasonable rationale). > > -- Sean Silva >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130630/7480c072/attachment.html>
Maybe Matching Threads
- [LLVMdev] [bikeshed] Anyone have strong feelings about always putting `template <...>` on its own line?
- [LLVMdev] [bikeshed] Anyone have strong feelings about always putting `template <...>` on its own line?
- [LLVMdev] [bikeshed] Anyone have strong feelings about always putting `template <...>` on its own line?
- [LLVMdev] [cfe-dev] -fsanitize=address on centos 6.4
- [LLVMdev] [bikeshed] Anyone have strong feelings about always putting `template <...>` on its own line?