[PATCH] D42684: clang-format: Allow optimizer to break template declaration.

Francois Ferrand via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 28 07:29:40 PST 2018


Typz added a comment.

The problem I have is really related to the current `AlwaysBreakTemplateDeclarations` behavior, which does not apply to functions.
I set it to false, and I get this:

  template<>
  void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      const bbbbbbbbbbbbbbbbbbb & cccccccccc);

instead of:

  template<> void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      const bbbbbbbbbbbbbbbbbbb & cccccccccc);

Then when this is fixed the penalty for breaking after the templates part is hardcoded to 10 (`prec::Level::Relational`), which was not always wrapping as expected (that is definitely subjective, but that is the beauty of penalties...)


Repository:
  rC Clang

https://reviews.llvm.org/D42684





More information about the cfe-commits mailing list