Skip to content

[style] [C] top-level && followed by an expression is styled incorrectly #108

@Starwort

Description

@Starwort

Simplified, minimal code example:

int do_work()
{
    int rv;
    should_do_work() && (rv = some_parenthetical_work_doer() + 1);
    return rv;
}

Style50 wants it reformatted to:

int do_work()
{
    int rv;
    should_do_work() &&(rv = some_parenthetical_work_doer() + 1);
    //               ^^^ space removed here
    return rv;
}

This is clearly an incorrect suggestion.

EDIT: Occurs also without the brackets, as in should_do_thing() && thing_doer();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions