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

Allow postfix ops on vector-dereferenced values #38

Open
elimirks opened this issue Dec 10, 2022 · 0 comments
Open

Allow postfix ops on vector-dereferenced values #38

elimirks opened this issue Dec 10, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@elimirks
Copy link
Owner

The following test case will fail on the final two asserts:

test_dereferenced() {
    printf("Testing dereferencing a vec while accessing an element*n");
    auto as[4] 1, 2, 3, 4, 5;
    auto ptr;
    ptr = &as;

    assert_eq_int(as[0], **ptr);
    assert_eq_int(as[0], *ptr[0]);
    assert_eq_int(as[2], *ptr[2]);

    assert_eq_int(3, as[2]);
    *ptr[2] =+ 1;
    assert_eq_int(4, as[2]);
    as[2]++;
    assert_eq_int(5, as[2]);
    (*ptr)[2]++;
    assert_eq_int(6, as[2]);
}

It complains that Compile error: ++ or -- must operate on a memory location.

@elimirks elimirks added the bug Something isn't working label Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant