Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Formatter breaks code while sorting includes #34251

Open Quuxplusone opened 7 years ago

Quuxplusone commented 7 years ago
Bugzilla Link PR35278
Status CONFIRMED
Importance P normal
Reported by Oleksii Vilchanskyi (oleksii.vilchanskyi@gmail.com)
Reported on 2017-11-11 08:17:40 -0800
Last modified on 2020-04-09 08:55:00 -0700
Version trunk
Hardware PC Linux
CC cory.nezin@gmail.com, djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org, mydeveloperday@gmail.com, oleksii.vilchanskyi@gmail.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also

Formatter breaks code while sorting includes.

Very simple repro:

=== foo.c:

#include <stdio.h>
#include <stdint.h> /* long
                       comment */

clang-format foo.c (so, the default config) reformats it to:

#include <stdint.h> /* long
#include <stdio.h>
                       comment */

clang-format --version: clang-format version 6.0.0 (trunk 317949)

Quuxplusone commented 5 years ago

Still reproducible with

clang-format version 8.0.1 (tags/RELEASE_801/final 366581)

Quuxplusone commented 5 years ago
Confirmed as of 10.0

$ clang-format include.cpp

#include <stdint.h> /* long
#include <stdio.h>
                       comment */

clang-format version 10.0.0 (https://github.com/llvm/llvm-project.git
b03a7c29085905c15746a725382e7cb327e08771)