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

            Bug ID: 36857
           Summary: clang-format misformats code
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

Config: https://github.com/mongodb/mongo/blob/master/.clang-format

Specific issues:

&& is has spaces on both sides when it should have none on left side (next line
is formatted correctly):
https://github.com/mongodb/mongo/blob/9799d8b7223205635ccb428bbec1ba4d947ba13b/src/mongo/util/future.h#L82
and
https://github.com/mongodb/mongo/blob/9799d8b7223205635ccb428bbec1ba4d947ba13b/src/mongo/util/future.h#L983

space between Type and *:
https://github.com/mongodb/mongo/blob/9799d8b7223205635ccb428bbec1ba4d947ba13b/src/mongo/util/future.h#L740-L741
 

spaces inside [] of lambda capture:
https://github.com/mongodb/mongo/blob/9799d8b7223205635ccb428bbec1ba4d947ba13b/src/mongo/util/future.h#L1050

function signature indented too much:
https://github.com/mongodb/mongo/blob/9799d8b7223205635ccb428bbec1ba4d947ba13b/src/mongo/util/future.h#L940
(compare to
https://github.com/mongodb/mongo/blob/9799d8b7223205635ccb428bbec1ba4d947ba13b/src/mongo/util/future.h#L1005
which is indented correctly)


Our official code is formatted by clang-format 3.8, but I've also tried 5.0 and
today's trunk, but they seem to still have these issues. Most of our code is
formatted very nicely by clang-format, but something about this file causes it
to behave very strangely. While I only linked to 1 or 2 instances of each
issue, they all occur several times in that file.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to