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

Incorrect codegen when using variables from a constexpr block in an injected function #31

Open
hamzasood opened this issue Jul 28, 2017 · 0 comments
Labels

Comments

@hamzasood
Copy link

I'd expect the following code:

class MyClass {
    constexpr {
        int val = 0;
        -> [val] class { int getFirst() { return val; } }
        ++val;
        -> [val] class { int getSecond() { return val; } }
    }
};

to produce:

int MyClass::getFirst() { return 0; }
int MyClass::getSecond() { return 1; }

However both functions generate the same code: return MyClass::val;.

@asutton asutton added the bug label Jul 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants