-
Notifications
You must be signed in to change notification settings - Fork 260
[BUG] in
argument passing to function that uses cpp2 user defined type failed with error
#270
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
Comments
@hsutter probably the easiest solution is to move definition of the class before any function declaration. |
After thinking more about it - the main issue is with the forward declaration of udt. We cannot use it. The order should be following:
|
Quick ack: Yes, that's the idea... last weekend's commit was a preliminary step, first of several, starting with just the most basic cases, UDTs are going to take me a few weeks to really rough in properly, piece by piece. Thanks for watching and for the constructive comments! |
There are two parts here: (1) Yes,
|
See the wiki documentation page: https://github.com/hsutter/cppfront/wiki/Cpp2:-operator=,-this-&-that See also the new `pure2-types-smf*.cpp2` test cases for examples. Made Cpp1 assignment "return *this;", closes #277 Changed in<T> to pass fundamental types by value. Only those are known to be always complete. Partly addresses #270. Also partly improves #282.
@hsutter I confirm that the original issue is solved now - thanks to switching to There is still issue with forward returns of |
OK, closing this as fixed. Thanks! |
Also, I've now addressed the #248 comment, thanks for the reminder here. |
See the wiki documentation page: https://github.com/hsutter/cppfront/wiki/Cpp2:-operator=,-this-&-that See also the new `pure2-types-smf*.cpp2` test cases for examples. Made Cpp1 assignment "return *this;", closes hsutter#277 Changed in<T> to pass fundamental types by value. Only those are known to be always complete. Partly addresses hsutter#270. Also partly improves hsutter#282.
258190e introduces the possibility of defining user-defined types in cpp2. Unfortunately, it fails with a free functions that use UDT as
in
parameters.The following code:
generates:
It fails on cpp1 compilation with the error:
The issue is that
in
argument passing is trying to figure out ifauto fun(cpp2::in<X> x) -> void;
passesx
by reference or by value - it distinguishes that based on the size of X. Unfortunately, at that point compiler does not know the size ofX
.The text was updated successfully, but these errors were encountered: