summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/test/Index/print-typekind.m7
-rw-r--r--clang/tools/libclang/CXTypes.cpp2
2 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Index/print-typekind.m b/clang/test/Index/print-typekind.m
new file mode 100644
index 00000000000..62cbb70c8ee
--- /dev/null
+++ b/clang/test/Index/print-typekind.m
@@ -0,0 +1,7 @@
+@interface Foo
+@property (readonly) id x;
+@end
+
+// RUN: c-index-test -test-print-typekind %s | FileCheck %s
+// CHECK: ObjCPropertyDecl=x:2:25 typekind=Typedef [canonical=ObjCObjectPointer]
+
diff --git a/clang/tools/libclang/CXTypes.cpp b/clang/tools/libclang/CXTypes.cpp
index 777afb9bb7a..ae756c7a1ee 100644
--- a/clang/tools/libclang/CXTypes.cpp
+++ b/clang/tools/libclang/CXTypes.cpp
@@ -116,6 +116,8 @@ CXType clang_getCursorType(CXCursor C) {
return MakeCXType(QualType(ID->getTypeForDecl(), 0), AU);
if (ValueDecl *VD = dyn_cast<ValueDecl>(D))
return MakeCXType(VD->getType(), AU);
+ if (ObjCPropertyDecl *PD = dyn_cast<ObjCPropertyDecl>(D))
+ return MakeCXType(PD->getType(), AU);
return MakeCXType(QualType(), AU);
}
OpenPOWER on IntegriCloud