From: Robert Bradshaw Date: Sat, 20 Feb 2010 02:06:37 +0000 (-0800) Subject: merge X-Git-Tag: 0.13.beta0~340 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b978c7e0aa0eebc5320a53652dab108e25a87af7;p=cython.git merge --- b978c7e0aa0eebc5320a53652dab108e25a87af7 diff --cc Cython/Compiler/Symtab.py index 9253f642,631c5f89..a031e97c --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@@ -1562,8 -1535,8 +1565,9 @@@ class CppClassScope(Scope) cname = None, visibility = 'extern', defining = 0, api = 0, in_pxd = 0, modifiers = ()): if name == self.name.split('::')[-1] and cname is None: + self.check_base_default_constructor(pos) name = '' + type.return_type = self.lookup(self.name).type prev_entry = self.lookup_here(name) entry = self.declare_var(name, type, pos, cname, visibility) if prev_entry: diff --cc tests/run/cpp_templates.pyx index 11944a53,1a700fea..e29bceae --- a/tests/run/cpp_templates.pyx +++ b/tests/run/cpp_templates.pyx @@@ -61,33 -58,4 +58,31 @@@ def test_pair(int i, double x) finally: del pair +def test_ptr(int i): + """ + >>> test_ptr(3) + 3 + >>> test_ptr(5) + 5 + """ - cdef Wrap[int*] *w + try: + w = new Wrap[int*](&i) + return deref(w.get()) + finally: + del w + +cdef double f(double x): + return x*x +def test_func_ptr(double x): + """ + >>> test_func_ptr(3) + 9.0 + >>> test_func_ptr(-1.5) + 2.25 + """ - cdef Wrap[double (*)(double)] *w + try: + w = new Wrap[double (*)(double)](&f) + return w.get()(x) + finally: + del w