[llvm-bugs] [Bug 40583] New: clang-format toggles between two different formattings

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 4 05:04:20 PST 2019


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

            Bug ID: 40583
           Summary: clang-format toggles between two different formattings
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: fhoffmann at softwareparadies.de
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Created attachment 21424
  --> https://bugs.llvm.org/attachment.cgi?id=21424&action=edit
minimized clang format files and source code examples

Clang toggles between two different formattings in some special cases.
This makes it impossible to use because there is no "correct" formatted code
any more.

example toggle1:

<     int maxH = ftoi((float)((aaaaaaaaaaa - iiiiiiiiiiiiiiiiii)
<                             / h)); // iiiiiiiiiiiiii llll     iiiii
aa.aa.aaaa aaaa iiiii pppp-1111
---
>     int maxH =
>         ftoi((float)((aaaaaaaaaaa - iiiiiiiiiiiiiiiiii)
>                      / h)); // iiiiiiiiiiiiii llll    iiiii aa.aa.aaaa aaaa iiiii pppp-1111

I could not find one specific example which explains all the problems, so I
have attached 4.


My first Idea was that tabs are the only problem but then I discovered example
4, without any tabs.

I hope the examples will help to find the bug.

OS: Windows 10
clang-format version: 7.0.1

-- 
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/20190204/46bbda83/attachment.html>


More information about the llvm-bugs mailing list