make sure we don't mistake ParmVarDecls for top-level decls.
Fixes rdar://
10920009.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151330
91177308-0d34-0410-b5e6-
96231b3b80d8
// We only keep track of the file-level declarations of each file.
if (!D->getLexicalDeclContext()->isFileContext())
return;
+ // FIXME: We should never have ParmVarDecls with TU as context.
+ if (isa<ParmVarDecl>(D))
+ return;
SourceManager &SM = Context->getSourceManager();
SourceLocation FileLoc = SM.getFileLoc(Loc);
--- /dev/null
+
+// rdar://10920009
+// RUN: c-index-test -write-pch %t.h.pch -x objective-c-header %S/targeted-cursor.m.h -Xclang -detailed-preprocessing-record
+// RUN: c-index-test -cursor-at=%S/targeted-cursor.m.h:5:13 %s -include %t.h | FileCheck %s
+
+// CHECK: ObjCClassRef=I:2:12
--- /dev/null
+
+@interface I
+
+-(void)mm:(void (^)(I*))block;
+-(void)mm2:(I*)i;
+
+@end