HomePhabricator

clang-format: Allow optimizer to break template declaration.

Description

clang-format: Allow optimizer to break template declaration.

Summary:
Introduce PenaltyBreakTemplateDeclaration to control the penalty,
and change AlwaysBreakTemplateDeclarations to an enum with 3 modes:

  • No for regular, penalty based, wrapping of template declaration
  • MultiLine for always wrapping before multi-line declarations (e.g. same as legacy behavior when AlwaysBreakTemplateDeclarations=false)
  • Yes for always wrapping (e.g. same as legacy behavior when AlwaysBreakTemplateDeclarations=true)

Reviewers: krasimir, djasper, klimek

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D42684

Details