Index: cfe/trunk/bindings/python/clang/cindex.py =================================================================== --- cfe/trunk/bindings/python/clang/cindex.py +++ cfe/trunk/bindings/python/clang/cindex.py @@ -1644,7 +1644,7 @@ def result_type(self): """Retrieve the Type of the result for this Cursor.""" if not hasattr(self, '_result_type'): - self._result_type = conf.lib.clang_getResultType(self.type) + self._result_type = conf.lib.clang_getCursorResultType(self) return self._result_type @@ -3568,6 +3568,11 @@ [Cursor, c_uint, c_uint], SourceRange), + ("clang_getCursorResultType", + [Cursor], + Type, + Type.from_result), + ("clang_getCursorSemanticParent", [Cursor], Cursor, Index: cfe/trunk/bindings/python/tests/cindex/test_cursor.py =================================================================== --- cfe/trunk/bindings/python/tests/cindex/test_cursor.py +++ cfe/trunk/bindings/python/tests/cindex/test_cursor.py @@ -429,6 +429,18 @@ 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')