blob: 8f0ae3ad5a559558901f2eb4d7cef8797c91a9a3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# mode: run
# tag: cpp, warnings
# This gives a warning about the previous .pxd definition, but should not give an error.
cdef cppclass Foo:
int _foo
int get_foo():
return this._foo
void set_foo(int foo):
this._foo = foo
def test_Foo(n):
"""
>>> test_Foo(1)
1
"""
cdef Foo* foo = NULL
try:
foo = new Foo()
foo.set_foo(n)
return foo.get_foo()
finally:
del foo
_WARNINGS = """
5:5: 'Foo' already defined (ignoring second definition)
"""
|