[llvm-bugs] [Bug 40046] New: clang-format fails formatting basic C++11 code

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Dec 17 03:24:57 PST 2018


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

            Bug ID: 40046
           Summary: clang-format fails formatting basic C++11 code
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Tooling
          Assignee: unassignedclangbugs at nondot.org
          Reporter: private at bernhard-lindner.de
                CC: llvm-bugs at lists.llvm.org

I evaluated clang-format with one of my projects. Evaluation failed due to
following problems

1. There is no way of adding missing empty lines (e.g. between function
definitions). There should be explicit options for mandatory empty lines.

2. I was not able to configure correct class indention (public: 3 spaces, class
members: 6 spaces, function definition: 3 spaces). There should be separate
options for indention of class members and function definitions.

3. Wrapping of constructor initialize lists fails as soon as
"BreakConstructorInitializers: AfterColon" is accompanied by a "ColumnLimit:
'160'". ColumnLimit seems to break BreakConstructorInitializers completely. See
also https://stackoverflow.com/q/53797967/1421332.

4. Wrapping of template specifications seems to work in one direction only. If
"template <typename T>" is in one line with the function, a line break is added
properly if required by "AlwaysBreakTemplateDeclarations: Yes". However when
having "template <typename T>" in a separate line, the line break is not
removed as required by "AlwaysBreakTemplateDeclarations: No".

Please fix these issues. clang-format is very promising. I am eager to evaluate
it again.

-- 
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/20181217/21dccea8/attachment-0001.html>


More information about the llvm-bugs mailing list