Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

clang-format toggles between two different formattings #39554

Open Quuxplusone opened 5 years ago

Quuxplusone commented 5 years ago
Bugzilla Link PR40583
Status NEW
Importance P normal
Reported by Frank Hoffmann (fhoffmann@softwareparadies.de)
Reported on 2019-02-04 05:04:20 -0800
Last modified on 2019-08-03 13:26:43 -0700
Version 7.0
Hardware PC Windows NT
CC djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org, sebastian@pipping.org
Fixed by commit(s)
Attachments report.zip (2220 bytes, application/x-zip-compressed)
Blocks
Blocked by
See also PR42509
Created attachment 21424
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
Quuxplusone commented 5 years ago

Attached report.zip (2220 bytes, application/x-zip-compressed): minimized clang format files and source code examples