1 /* RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify
3 struct incomplete
; // expected-note{{forward declaration of 'struct incomplete'}}
5 int sub1(int *a
, double *b
) {
6 return a
- b
; /* expected-error{{not pointers to compatible types}} */
9 void *sub2(struct incomplete
*P
) {
10 return P
-4; /* expected-error{{arithmetic on a pointer to an incomplete type 'struct incomplete'}} */
14 return P
-4; /* expected-warning{{arithmetic on a pointer to void is a GNU extension}} */
17 int sub4(void *P
, void *Q
) {
18 return P
-Q
; /* expected-warning{{arithmetic on pointers to void is a GNU extension}} */
21 int sub5(void *P
, int *Q
) {
22 return P
-Q
; /* expected-error{{not pointers to compatible types}} */
25 int logicaland1(int a
) {
26 return a
&& (void)a
; /* expected-error{{invalid operands}} */