Fix tests after #355
authorRobert Bradshaw <robertwb@math.washington.edu>
Fri, 11 Sep 2009 02:33:52 +0000 (19:33 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Fri, 11 Sep 2009 02:33:52 +0000 (19:33 -0700)
Cython/Compiler/Symtab.py
tests/errors/e_ctypedefornot.pyx

index 97cb026ae3ab1ce069a15f5b9fef45d4c411c4ac..b649fbaae9562645df86b0ce26d33279b30afb4a 100644 (file)
@@ -1014,6 +1014,8 @@ class ModuleScope(Scope):
         # the non-typedef struct internally to avoid needing forward
         # declarations for anonymous structs. 
         if typedef_flag and visibility != 'extern':
+            if visibility != 'public':
+                warning(pos, "ctypedef only valid for public and extern classes", 2)
             objtypedef_cname = objstruct_cname
             objstruct_cname = None
             typedef_flag = 0
index 1e9491ae074f357527b9095f03c788c328ff7e50..a0e18237e6984f5e324e3f26f10c65b32493be64 100644 (file)
@@ -8,16 +8,10 @@ ctypedef struct Blarg:
 
 cdef struct Blarg
 
-cdef class Spam
-
-ctypedef class Spam:
-       pass
-       
 cdef Foo f
 cdef Blarg b
 
 _ERRORS = u"""
 3:0: 'Foo' previously declared using 'cdef'
 9:5: 'Blarg' previously declared using 'ctypedef'
-13:0: 'Spam' previously declared using 'cdef'
 """