fix-its.c 828 B

123456789101112131415161718192021222324252627
  1. // RUN: c-index-test -test-load-source all -fspell-checking %s 2> %t
  2. // RUN: FileCheck %s < %t
  3. struct X {
  4. int wibble;
  5. };
  6. #define MACRO(X) X
  7. void f(struct X *x) {
  8. // CHECK: error: no member named 'wobble' in 'struct X'; did you mean 'wibble'?
  9. // CHECK: FIX-IT: Replace [13:12 - 13:18] with "wibble"
  10. // CHECK: note: 'wibble' declared here
  11. MACRO(x->wobble = 17);
  12. // CHECK: error: no member named 'wabble' in 'struct X'; did you mean 'wibble'?
  13. // CHECK: FIX-IT: Replace [17:6 - 17:12] with "wibble"
  14. // CHECK: note: 'wibble' declared here
  15. x->wabble = 17;
  16. }
  17. int printf(const char *restrict, ...);
  18. void f2() {
  19. unsigned long index;
  20. // CHECK: warning: format specifies type 'int' but the argument has type 'unsigned long'
  21. // CHECK: FIX-IT: Replace [26:17 - 26:19] with "%lu"
  22. MACRO(printf("%d", index));
  23. }