Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Starwort opened this issue Aug 13, 2022 · 2 comments
Open

Comments

@Starwort
Copy link

Starwort commented Aug 13, 2022

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();

@BenTaylor25
Copy link

diff: && ( -> &&(

@Starwort Starwort changed the title [style] [C] top-level && followed by a parenthesised expression is styled incorrectly [style] [C] top-level && followed by an expression is styled incorrectly Aug 13, 2022
@Starwort
Copy link
Author

My guess as to why this happens is that it believes the && operator to be acting as a reference here, despite that not making much sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants