Commit 57fe4a6e authored by David Barnett's avatar David Barnett

C++ failures / tests

I noticed two failures to compile that I think are bugs:
 - "ctypedef Foo[int] Bar" gives a syntax error (i.e., there doesn't seem to be any way to typedef a templated type).
 - Defining a struct in a namespace and trying to convert it to a Python dict doesn't work. Instead you get nasty "__pyx_convert__to_py_THENAMESPACE" errors from the C++ compiler (it doesn't mangle the cname properly and tries to define __pyx_convert__to_py_THENAMESPACE::THESTRUCT).

I made a patch to *add tests* for the two bugs (not fix them).
parent 8be7e855
cdef extern from "point.h" namespace "geometry":
cdef struct Point:
double x
double y
int color
cdef Point p = Point(0.0, 0.0, 0)
the_point = p
cdef extern from *:
cdef cppclass Foo[T]:
pass
ctypedef Foo[int] IntFoo
#ifndef POINT_H
#define POINT_H
namespace geometry {
struct Point
{
double x;
double y;
int color;
};
}
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment