summaryrefslogtreecommitdiffstats
path: root/clang/bindings/python/tests
diff options
context:
space:
mode:
authorJonathan Coe <jbcoe@me.com>2018-04-22 20:51:05 +0000
committerJonathan Coe <jbcoe@me.com>2018-04-22 20:51:05 +0000
commit578fe177d467bfbd0814de83814575111b493bda (patch)
tree1a01c99f18d480e10abf5cb8d2b24a6b54a23fa4 /clang/bindings/python/tests
parent87ba905fe96469c65767f28bab4893ad32e15c02 (diff)
downloadbcm5719-llvm-578fe177d467bfbd0814de83814575111b493bda.tar.gz
bcm5719-llvm-578fe177d467bfbd0814de83814575111b493bda.zip
[python bindings] Fix Cursor.result_type for ObjC method declarations - Bug 36677
Summary: In cindex.py, Cursor.result_type called into the wrong libclang function, causing cursors for ObjC method declarations to return invalid result types. Fixes Bug 36677. Reviewers: jbcoe, rsmith Reviewed By: jbcoe Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D45671 Patch by kjteske (Kyle Teske). llvm-svn: 330557
Diffstat (limited to 'clang/bindings/python/tests')
-rw-r--r--clang/bindings/python/tests/cindex/test_cursor.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/bindings/python/tests/cindex/test_cursor.py b/clang/bindings/python/tests/cindex/test_cursor.py
index c2a4eb57d02..2575ffb8a51 100644
--- a/clang/bindings/python/tests/cindex/test_cursor.py
+++ b/clang/bindings/python/tests/cindex/test_cursor.py
@@ -429,6 +429,18 @@ class TestCursor(unittest.TestCase):
t = foo.result_type
self.assertEqual(t.kind, TypeKind.INT)
+ def test_result_type_objc_method_decl(self):
+ code = """\
+ @interface Interface : NSObject
+ -(void)voidMethod;
+ @end
+ """
+ tu = get_tu(code, lang='objc')
+ cursor = get_cursor(tu, 'voidMethod')
+ result_type = cursor.result_type
+ self.assertEqual(cursor.kind, CursorKind.OBJC_INSTANCE_METHOD_DECL)
+ self.assertEqual(result_type.kind, TypeKind.VOID)
+
def test_availability(self):
tu = get_tu('class A { A(A const&) = delete; };', lang='cpp')
OpenPOWER on IntegriCloud