--- /dev/null
+// RUN: clang-cc -emit-pch %s -o %t.ast &&
+// RUN: index-test %t.ast -point-at %s:8:4 -print-decls | count 2 &&
+// RUN: index-test %t.ast -point-at %s:8:4 -print-defs | count 1
+
+static void foo(int x);
+
+static void bar(void) {
+ foo(10);
+}
+
+void foo(int x) {
+}
case PrintDecls :
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
- while (FD) {
- ASTLocation(FD).print(OS);
- FD = FD->getPreviousDeclaration();
- }
+ for (FunctionDecl::redecl_iterator I = FD->redecls_begin(),
+ E = FD->redecls_end(); I != E; ++I)
+ ASTLocation(*I).print(OS);
} else if (const VarDecl *VD = dyn_cast<VarDecl>(D)) {
- while (VD) {
- ASTLocation(VD).print(OS);
- VD = VD->getPreviousDeclaration();
- }
+ for (VarDecl::redecl_iterator I = VD->redecls_begin(),
+ E = VD->redecls_end(); I != E; ++I)
+ ASTLocation(*I).print(OS);
} else
ASTLocation(D).print(OS);
break;