2008-01-08 09:11:38 +08:00
|
|
|
// RUN: clang -fsyntax-only -verify -pedantic %s
|
|
|
|
void foo() {
|
|
|
|
*(0 ? (double *)0 : (void *)0) = 0;
|
2008-01-14 10:53:34 +08:00
|
|
|
*(0 ? (double *)0 : (void *)(int *)0) = 0;
|
|
|
|
*(0 ? (double *)0 : (void *)(double *)0) = 0;
|
|
|
|
*(0 ? (double *)0 : (int *)(void *)0) = 0; // expected-warning {{pointer type mismatch ('double *' and 'int *')}}
|
|
|
|
*(0 ? (double *)0 : (double *)(void *)0) = 0;
|
|
|
|
*((void *) 0) = 0; // expected-error {{incomplete type 'void' is not assignable}}
|
2008-01-08 09:11:38 +08:00
|
|
|
double *dp;
|
|
|
|
int *ip;
|
|
|
|
void *vp;
|
|
|
|
|
|
|
|
dp = vp;
|
|
|
|
vp = dp;
|
2008-01-14 10:53:34 +08:00
|
|
|
ip = dp; // expected-warning {{incompatible pointer types assigning 'double *', expected 'int *'}}
|
|
|
|
dp = ip; // expected-warning {{incompatible pointer types assigning 'int *', expected 'double *'}}
|
2008-01-08 09:11:38 +08:00
|
|
|
dp = 0 ? (double *)0 : (void *)0;
|
|
|
|
vp = 0 ? (double *)0 : (void *)0;
|
2008-01-14 10:53:34 +08:00
|
|
|
ip = 0 ? (double *)0 : (void *)0; // expected-warning {{incompatible pointer types assigning 'double *', expected 'int *'}}
|
2008-01-08 09:11:38 +08:00
|
|
|
}
|
|
|
|
|