Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

clang-format breaks code #36746

Open Quuxplusone opened 6 years ago

Quuxplusone commented 6 years ago
Bugzilla Link PR37773
Status NEW
Importance P normal
Reported by Adrian Imboden (adi@thingdust.com)
Reported on 2018-06-11 12:57:45 -0700
Last modified on 2018-06-11 12:58:32 -0700
Version 6.0
Hardware PC Linux
CC adi@thingdust.com, djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments before_format.cpp (68 bytes, text/x-c++src)
after_format.cpp (67 bytes, text/x-c++src)
.clang-format (2665 bytes, text/plain)
Blocks
Blocked by
See also
Created attachment 20417
file before it was formatted

Hi all

I just found out, that clang-format breaks my code in my configuration (I
formatted a previously non-clang-formatted file).

I did not found out which configuration actually triggers the bug. The standard
configurations (WebKit, Google, etc. do not trigger the bug). My configuration
is based on WebKit.

This is a minimal example triggering the bug:
https://github.com/adrianimboden/clang-format-bug-reproducer

It seems that the comment at the end of the function definition somehow
confuses clang-format.
Quuxplusone commented 6 years ago

Attached before_format.cpp (68 bytes, text/x-c++src): file before it was formatted

Quuxplusone commented 6 years ago

Attached after_format.cpp (67 bytes, text/x-c++src): file after it was formatted

Quuxplusone commented 6 years ago

Attached .clang-format (2665 bytes, text/plain): configuration