]> granicus.if.org Git - clang/commitdiff
Add TypeKind.CONSTANTARRAY, from Anders Waldenborg!
authorDouglas Gregor <dgregor@apple.com>
Wed, 19 Oct 2011 05:50:34 +0000 (05:50 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 19 Oct 2011 05:50:34 +0000 (05:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142476 91177308-0d34-0410-b5e6-96231b3b80d8

bindings/python/clang/cindex.py
bindings/python/tests/cindex/test_type.py

index ee8c5e8384740e8a4b8aba48959a085cbc397dd9..8f1a8b8cce6bc38eebccfd9c9477ca2f78149bd8 100644 (file)
@@ -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):
     """
index cd27a4cbb98dafb8a8de75356a0498af17fe1498..35c7bbbfa2fa72d49d17a744e9fcbf4d01d6b6ff 100644 (file)
@@ -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??"