Skip to content

Output not deterministic when run with a multi-line comment on a single line #36826

Closed as not planned
@llvmbot

Description

@llvmbot
Bugzilla Link 37478
Version unspecified
OS MacOS X
Reporter LLVM Bugzilla Contributor

Extended Description

Running clang-format on its own output results in a different output for
the following example. Is this expected behavior? The example has a
multi-line comment on a single line of a function body.

$ clang-format -version
clang-format version 7.0.0 (tags/google/stable/2018-01-11)

$ cat foo.c
void foo() {
/* THIS IS A COMMENT */
}

$ clang-format foo.c > foo2.c
$ cat foo2.c
void foo() { /* THIS IS A COMMENT */ }

$ clang-format foo2.c > foo3.c
$ cat foo3.c
void foo() { /* THIS IS A COMMENT */
}

Thank You,
Akhil Indurti

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang-formatobsoleteIssues with old (unsupported) versions of LLVM

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions