code-completion-skip-bodies.cpp 519 B

1234567891011121314151617181920
  1. // This is to make sure we skip function bodies.
  2. void func_to_skip() {
  3. undeclared1 = 0;
  4. }
  5. struct S { int x; };
  6. void func(S *s) {
  7. undeclared2 = 0;
  8. s->x = 0;
  9. }
  10. // RUN: c-index-test -code-completion-at=%s:11:6 %s 2> %t.stderr | FileCheck %s --check-prefix=STDOUT
  11. // RUN: FileCheck --input-file=%t.stderr --check-prefix=STDERR %s
  12. // STDOUT: FieldDecl:{ResultType int}{TypedText x}
  13. // STDERR-NOT: error: use of undeclared identifier 'undeclared1'
  14. // STDERR: error: use of undeclared identifier 'undeclared2'