Skip to content

Wrong formatting of labels in preprocessor lines #92300

Closed
@Julien-Elie

Description

@Julien-Elie

Contrary to previous versions, clang-format 18 reformats:

#    define TXN_START(label, tid) \
    label:                        \
        TXN_START_NORETRY(label, tid)

#    define failure_response           \
    failure:                           \
        simple_response(client, code); \
        break;

as:

#    define TXN_START(label, tid) label : TXN_START_NORETRY(label, tid)

#    define failure_response                     \
        failure : simple_response(client, code); \
        break;

I don't think it is the expected output. Previous versions of clang-format kept it unchanged. It looks like : is now interpreted as a colon in a ternary operation instead of a colon following a label name.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions