Skip to content

[clang-format] Formatting for sizeof compound literal is incorrect #168237

@accelbread

Description

@accelbread

When using sizeof without parens on an expression, there is a space between the operator and the expression.

When sizeof is applied to a compound literal, the space is removed, making it seem that is is the sizeof a type and not sizeof a value.

int main() {
    // current formatting for sizeof compound literal:
    sizeof(int) {};
    // expected formatting:
    // sizeof (int) {};
}

Metadata

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