Steve Naroff | b6d54e5 | 2008-01-08 01:11:38 +0000 | [diff] [blame^] | 1 | // RUN: clang -fsyntax-only -verify -pedantic %s |
| 2 | void foo() { |
| 3 | *(0 ? (double *)0 : (void *)0) = 0; |
| 4 | *((void *) 0) = 0; // -expected-warning {{dereferencing void pointer}} -expected-error {{incomplete type 'void' is not assignable}} |
| 5 | double *dp; |
| 6 | int *ip; |
| 7 | void *vp; |
| 8 | |
| 9 | dp = vp; |
| 10 | vp = dp; |
| 11 | ip = dp; // -expected-warning {{incompatible pointer types assigning 'double *', expected 'int *'}} |
| 12 | dp = ip; // -expected-warning {{incompatible pointer types assigning 'int *', expected 'double *'}} |
| 13 | dp = 0 ? (double *)0 : (void *)0; |
| 14 | vp = 0 ? (double *)0 : (void *)0; |
| 15 | ip = 0 ? (double *)0 : (void *)0; // -expected-warning {{incompatible pointer types assigning 'double *', expected 'int *'}} |
| 16 | } |
| 17 | |