Skip to content

clang-format adds new line between semicolon and body-less loop #61708

Closed
@Jorenar

Description

I'm gonna borrow example from this SO question (and here's a similar one):

I want to configure clang-format that it leaves single-line while-statement without adding a line break for the trailing semicolon.
For example, clang-format should just leave a "one-liner" as it is:

while (checkWaitCondition() != true);

But unfortunately it adds by default a line break (plus an indentation):

while (checkWaitCondition() != true)
  ;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions