Ticket #523 (new defect)

Opened 5 months ago

Last modified 7 weeks ago

Compiler crash in C++ declarations

Reported by: robertwb Owned by: somebody
Priority: major Milestone: 0.13.1
Component: C++ Keywords:
Cc:

Description

 http://groups.google.com/group/cython-users/browse_thread/thread/34dd7cecbffcfd44

...
 File "/home/matt/Downloads/cython-devel-d9a3831ec027/cython-devel-
d9a3831ec027/Cython/Compiler/Nodes.py", line 1050, in
analyse_declarations
   attr.analyse_declarations(scope)
 File "/home/matt/Downloads/cython-devel-d9a3831ec027/cython-devel-
d9a3831ec027/Cython/Compiler/Nodes.py", line 939, in
analyse_declarations
   api = self.api)
 File "/home/matt/Downloads/cython-devel-d9a3831ec027/cython-devel-
d9a3831ec027/Cython/Compiler/Symtab.py", line 1564, in
declare_cfunction
   self.check_base_default_constructor(pos)
 File "/home/matt/Downloads/cython-devel-d9a3831ec027/cython-devel-
d9a3831ec027/Cython/Compiler/Symtab.py", line 1537, in
check_base_default_constructor
   if len(entry.type.base_classes) == 0:
AttributeError: 'CStructOrUnionType' object has no attribute
'base_classes'

Attachments

badmat.h Download (285 bytes) - added by MattBro 5 months ago.
simple .pyx and .h files to replicate bug
badmat.pyx Download (0.5 KB) - added by MattBro 5 months ago.

Change History

Changed 5 months ago by robertwb

  • milestone changed from wishlist to 0.13

Changed 5 months ago by MattBro

simple .pyx and .h files to replicate bug

Changed 5 months ago by MattBro

Changed 5 months ago by MattBro

So the issue appears to be that my attempt to forward declare gpumat (ahh that should have been replaced with badmat in my example), results in an error when declaring the gpumat constructor. Thus currently forward declarations are precluded.

However this will create problems for sufficiently complex C++ code. In my case I have a subclass of gpumat (cupper) that I need to forward declare in my C++ code. That's because a method in the gpumat class (qr() ) returns a cupper. How can this be done in the current C++ wrapper code?

Changed 7 weeks ago by robertwb

  • milestone changed from 0.13 to 0.13.1
Note: See TracTickets for help on using tickets.