aboutsummaryrefslogtreecommitdiff
path: root/bindings
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-12-09 18:30:42 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-12-09 18:30:42 +0000
commit9da628931ebf2609493570f87824ca22402cc65f (patch)
tree81d5fcacdf8f076da7b2359bb7d62be6a453f0da /bindings
parent36981b17ed939300f6f8fc2355a255f711fcef71 (diff)
downloadsrc-9da628931ebf2609493570f87824ca22402cc65f.tar.gz
src-9da628931ebf2609493570f87824ca22402cc65f.zip
Vendor import of clang 3.0 final release:vendor/clang/clang-r145349
Notes
Notes: svn path=/vendor/clang/dist/; revision=228366 svn path=/vendor/clang/clang-r145349/; revision=228367; tag=vendor/clang/clang-r145349
Diffstat (limited to 'bindings')
-rw-r--r--bindings/python/clang/cindex.py4
-rw-r--r--bindings/python/tests/cindex/test_type.py19
2 files changed, 21 insertions, 2 deletions
diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py
index 35c423d7d898..7cc9ddaf7646 100644
--- a/bindings/python/clang/cindex.py
+++ b/bindings/python/clang/cindex.py
@@ -815,7 +815,7 @@ class Cursor(Structure):
The Cursor class represents a reference to an element within the AST. It
acts as a kind of iterator.
"""
- _fields_ = [("_kind_id", c_int), ("data", c_void_p * 3)]
+ _fields_ = [("_kind_id", c_int), ("xdata", c_int), ("data", c_void_p * 3)]
def __eq__(self, other):
return Cursor_eq(self, other)
@@ -1019,7 +1019,7 @@ TypeKind.OBJCINTERFACE = TypeKind(108)
TypeKind.OBJCOBJECTPOINTER = TypeKind(109)
TypeKind.FUNCTIONNOPROTO = TypeKind(110)
TypeKind.FUNCTIONPROTO = TypeKind(111)
-
+TypeKind.CONSTANTARRAY = TypeKind(112)
class Type(Structure):
"""
diff --git a/bindings/python/tests/cindex/test_type.py b/bindings/python/tests/cindex/test_type.py
index cd27a4cbb98d..35c7bbbfa2fa 100644
--- a/bindings/python/tests/cindex/test_type.py
+++ b/bindings/python/tests/cindex/test_type.py
@@ -74,3 +74,22 @@ def test_a_struct():
else:
assert False, "Didn't find teststruct??"
+
+
+constarrayInput="""
+struct teststruct {
+ void *A[2];
+};
+"""
+def testConstantArray():
+ index = Index.create()
+ tu = index.parse('t.c', unsaved_files = [('t.c',constarrayInput)])
+
+ for n in tu.cursor.get_children():
+ if n.spelling == 'teststruct':
+ fields = list(n.get_children())
+ assert fields[0].spelling == 'A'
+ assert fields[0].type.kind == TypeKind.CONSTANTARRAY
+ break
+ else:
+ assert False, "Didn't find teststruct??"