- Fix assert in clang_getCursorDecl (having to do with recently added ObjC_ProtocolRef).
- Make sure CHECK: lines in test case match the expected output.
llvm-svn: 83316
diff --git a/clang/tools/CIndex/CIndex.cpp b/clang/tools/CIndex/CIndex.cpp
index 90fe3a8..9204d18 100644
--- a/clang/tools/CIndex/CIndex.cpp
+++ b/clang/tools/CIndex/CIndex.cpp
@@ -606,7 +606,8 @@
if (clang_isReference(C.kind)) {
if (C.stmt) {
- if (C.kind == CXCursor_ObjCClassRef)
+ if (C.kind == CXCursor_ObjCClassRef ||
+ C.kind == CXCursor_ObjCProtocolRef)
return static_cast<Stmt *>(C.stmt);
else
return getDeclFromExpr(static_cast<Stmt *>(C.stmt));