[bug #59775] "error: mark_as_constructed: invalid object" when constructor returns classdef array

Markus Mützel <[email protected]>
Newsgroups gmane.comp.gnu.octave.bugs
Message-ID <[email protected]>
Please use the bug tracker to post updates to a bug report.  The mailing list is intended as a read-only notification stream.  Info posted to this mailing list address won't appear in the tracker database where it is most useful.

Update of bug #59775 (group octave):

                  Status:               Confirmed => Patch Reviewed

    _______________________________________________________

Follow-up Comment #13:

Thanks for the patch and sorry for the late review.

I haven't attempted to build with the patch yet.

A few early comments after reading the patch:

@@ -573,7 +577,7 @@
   OCTINTERP_API bool
   is_partially_constructed_for (const cdef_class& cls) const;
 
-  void mark_as_constructed () { m_ctor_list.clear (); }
+  OCTINTERP_API void mark_as_constructed () { m_ctor_list.clear (); }
 
   OCTINTERP_API void mark_as_constructed (const cdef_class& cls);
 


This hunk adds a macro that will expand to a dllimport attribute in downstream
projects on Windows to a function *definition*. That will cause a compiler
error on Windows.
The "normal" `*_API` attributes should only be added if a (downstream)
compilation unit including this header would only contain a declaration of the
function (but no definition).

You are using MATLAB compatible syntax in the classdef files for the new
tests. Is that on purpose?

There are a couple of trailing spaces in the classdef files (in the first line
of each file). Trailing whitespace should be removed (unless syntactically
necessary, which it isn't in a .m file). Maybe, your favorite editor has a
shortcut or macro for that?


The actual change looks reasonable to me. 👍



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59775>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCac52DAAKCRCqLAuaBUf3
Tv/UAP4x54/m0OmI5vK0vcMIsPWzmvd6+JpHltDpldgxrIClQQEA3uS6GjXz4CkH
hTnKvvtnXNWTE4cbzDjfp4GGqDP7Lgo=
=4NsM
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.