Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 1 | _Complex cd; // CHECK: code-complete-errors.c:1:1: warning: plain '_Complex' requires a type specifier; assuming '_Complex double' |
Douglas Gregor | 51c6d38 | 2010-01-29 00:41:11 +0000 | [diff] [blame] | 2 | // CHECK: FIX-IT: Insert " double" at 1:9 |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 3 | struct s { |
Douglas Gregor | f13ca06 | 2010-06-16 23:08:59 +0000 | [diff] [blame] | 4 | int x, y;; // CHECK: code-complete-errors.c:4:12: warning: extra ';' inside a struct |
Daniel Dunbar | 51b058c | 2010-02-14 08:32:24 +0000 | [diff] [blame] | 5 | }; // CHECK: FIX-IT: Remove [4:12 - 4:13] |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 6 | |
| 7 | struct s s0 = { y: 5 }; // CHECK: code-complete-errors.c:7:20: warning: use of GNU old-style field designator extension |
Daniel Dunbar | 51b058c | 2010-02-14 08:32:24 +0000 | [diff] [blame] | 8 | // CHECK: FIX-IT: Replace [7:17 - 7:19] with ".y = " |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 9 | int f(int *ptr1, float *ptr2) { |
Douglas Gregor | 0a812cf | 2010-02-18 23:07:20 +0000 | [diff] [blame] | 10 | return ptr1 != ptr2; // CHECK: code-complete-errors.c:10:15:{10:10-10:14}{10:18-10:22}: warning: comparison of distinct pointer types ('int *' and 'float *') |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 11 | } |
| 12 | |
Douglas Gregor | a9b06d4 | 2010-11-09 06:24:54 +0000 | [diff] [blame] | 13 | #define expand_to_binary_function(ret, name, parm1, parm2, code) ret name(parm1, parm2) code |
| 14 | |
| 15 | expand_to_binary_function(int, g, int *ip, float *fp, { |
| 16 | // CHECK: code-complete-errors.c:17:15:{17:12-17:14}{17:18-17:20}: warning: comparison of distinct pointer types ('int *' and 'float *') |
| 17 | return ip == fp; |
| 18 | }) |
| 19 | |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 20 | void g() { } |
| 21 | |
Douglas Gregor | a9b06d4 | 2010-11-09 06:24:54 +0000 | [diff] [blame] | 22 | // RUN: c-index-test -code-completion-at=%s:19:12 -pedantic %s 2> %t |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 23 | // RUN: FileCheck -check-prefix=CHECK %s < %t |