You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bar: (foo: uint32_t) -> uint32_t = {
x := foo >> 16;
y := foo & 0xFFFF;
return (x+1) ^ (y-1);
}
gives
example.cpp2(4,22): error: - - pointer arithmetic is illegal - use std::span or gsl::span instead
==> program violates bounds safety guarantee - see previous errors
If I explicitly say that y is a uint32_t, everything is fine, but why does cppfront think that it's a pointer?
(I've seen the same issue with x, but it doesn't reproduce in this example.)
The text was updated successfully, but these errors were encountered:
Yes, but this means that it's going back to the line where y is declared to determine whether it's a pointer or not, and not parsing it properly, which seems odd to me.
When creating a variable using >> or & on an integral type, somehow the deduced type is some kind of pointer rather than an integer.
https://cpp2.godbolt.org/z/sf4Y7MxMz
gives
If I explicitly say that y is a uint32_t, everything is fine, but why does cppfront think that it's a pointer?
(I've seen the same issue with x, but it doesn't reproduce in this example.)
The text was updated successfully, but these errors were encountered: