[llvm-bugs] [Bug 42167] New: Clang-format Add Option to Suppress Break of Template Declaration with Empty Parameter List

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jun 6 09:34:34 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42167

            Bug ID: 42167
           Summary: Clang-format Add Option to Suppress Break of Template
                    Declaration with Empty Parameter List
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: matthias.schaefer at versasec.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Though it is useful to break template declarations in general with the
AlwaysBreakTemplateDeclarations setting, it might not always be as useful to
break template declarations which have an empty parameter list, which is
usually the case for function template specializations, as partial
specializations as not allowed for function templates. For the sake of
completeness, it should also be possible to suppress breaking all other
template declarations which have an empty parameter list.

I propose to add a new setting SuppressEmptyTemplateDeclarationsBreak with the
options:
- Never, the default value and all breaking is done according to the
AlwaysBreakTemplateDeclarations setting,
- Functions, only breaks of empty function template declarations are suppressed
and all non-empty function template declarations and all non-function template
declarations are performed according to the AlwaysBreakTemplateDeclarations
setting, and
- Always, breaks of all empty template declarations are suppressed, non-empty
template declarations are performed according to the
AlwaysBreakTemplateDeclarations setting.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190606/2be0cdb3/attachment-0001.html>


More information about the llvm-bugs mailing list