We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In section 1.3.2 inout parameters of https://github.com/hsutter/708/blob/main/708.pdf you specify that
1.3.2 inout parameters
If the function is nonvirtual, at least one path must contain a non-const use of x (else the parameter should be in).
In the current implementation of cppfront the following code compiles:
f2: (inout x) -> _ = { return x * 2; } main: () -> int = { x := 21; std::cout << f2(x) << std::endl; x = 0; // workaround for another bug }
And generate output:
42
cppfront should end with an error informing to use in argument passing instead of inout.
in
inout
The text was updated successfully, but these errors were encountered:
Right, I'm not able to detect that right now so it's not possible to issue that diagnostic.
I could probably do this if I required a mutating argument to be qualified with inout, which I've thought of and @jbatez suggested in #198.
I see there's a related issue in #231 which might also be solved with an inout argument (call-site) requirement...
Sorry, something went wrong.
I found that issue while playing with for..do loops.
I assume that there is no call-site there.
out
forward
move
No branches or pull requests
In section
1.3.2 inout parameters
of https://github.com/hsutter/708/blob/main/708.pdf you specify thatIn the current implementation of cppfront the following code compiles:
And generate output:
Expectations
cppfront should end with an error informing to use
in
argument passing instead ofinout
.The text was updated successfully, but these errors were encountered: