[LLVMdev] [bikeshed] Anyone have strong feelings about always putting `template <...>` on its own line?

David Blaikie dblaikie at gmail.com
Mon Jul 1 14:40:39 PDT 2013


On Mon, Jul 1, 2013 at 2:38 PM, Sean Silva <silvas at purdue.edu> wrote:
>
>
>
> On Mon, Jul 1, 2013 at 2:31 PM, David Blaikie <dblaikie at gmail.com> wrote:
>>
>>
>> Have you got any statistics for the current state of LLVM with respect
>> to this formatting issue? If something is already the overwhelmingly
>> common style (& it's not a case where it used to be the style, the
>> style has been updated, and nothing has been migrated yet) then just
>> make clang-format agree with reality - this doesn't require a
>> discussion or bikeshed.
>
>
> It's not overwhelming, but the preponderance seems to be towards putting it
> on its own line (the exceptions are usually small trait specializations like
> isPodLike). I give some rough numbers here
> <http://thread.gmane.org/gmane.comp.compilers.llvm.devel/63378>

Fair enough - could we draw any further stylistic conclusions that
could motivate clang-format? If the entire definition of the template
fits on one line is it pretty consistent that it's defined on the one
line rather than split? What about template declarations, if any?

> (and see
> Daniel's reply). Daniel is open to changing it, but asked me to gather some
> more opinions.
>
> -- Sean Silva



More information about the llvm-dev mailing list