Skip to content

Parser parses unary operator on member of structs incorrectly #46

Open
@abcdehello

Description

@abcdehello

It seems like the parser will incorrectly parse statements of a unary operator applied on a member variable of a struct as a binomial expression instead.

Example:

#include <iostream>
struct{
    int a;
    int c[5];
}b;
int main(){
    b.a++;
    b.c[0]++;
}

The expression b.a++ is parsed as a binary expression with operator . with terms b and a++ instead of a unary expression of ++ on b.a, which seems to be a mistake. The same goes for b.c[0]++.

Is it possible to issue a fix on this? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions