[LLVMdev] clang-format: `AlwaysBreakTemplateDeclarations: true` for LLVMStyle?

Sean Silva silvas at purdue.edu
Wed Jun 26 11:29:47 PDT 2013


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>


More information about the llvm-dev mailing list