[PATCH] D12921: clang-format: Support 'template<>' (no space).

Paul Hoad via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 17 00:30:33 PDT 2015


MyDeveloperDay added a subscriber: MyDeveloperDay.
MyDeveloperDay added a comment.

This looks like a good small change.

What is interesting to me is that even the twiki page about template is inconsistent in its style (https://en.wikipedia.org/wiki/Template_(C%2B%2B)), so its not like there is "one style to rule them all"  (some have spaces, some do not)

@djasper, I don't understand here what we mean by "cost" in your review comment  (performance, maintainability?), the change has unit tests to keep it honest and its just an additional expression on an 'if', is there something else we should be concerned about when submitting patches? (long term maintainability?)

It does sound a little to me like we might be want to reject it because we don't like this style and don't want to proliferate its continued use, and can't understand why anyone would do it that way.  Unfortunately that is not very realistic for those of us who want to introduce clang-format into a code base that predates clang, google and for some of us even the internet! which might have it own style guide which doesn't quite match clang (not quite)

In my view this finite control over every aspect of a style is what clang-format needs, we need clang-format to allow the individuals who maintain large code bases to be able to fine tune the style to meet our companies own documented style, then we can introduce it to automate that style. But the concept that we might be able to alter that style guide of our company and inflict a tidal wave of changes onto previously conforming code is unfortunately not possible.

I know this may not match llvm,clangs requirements but they are possibly the requirements to ensure clang-format becomes completely ubiquitous in the industry.

This review like my own review for similar finite control over else and catch (http://reviews.llvm.org/D12492) is obviously not the way that clang-format wants to go, we want to contribute but can't do it if our patches aren't included, do you have a recommendation?

Could I ask you to reconsider this review, I'm willing to help.


http://reviews.llvm.org/D12921





More information about the cfe-commits mailing list