blob: 95f364fc676bb9854c2e8c18b277b55c30d34608 [file] [log] [blame]
Eli Friedmand72d16e2008-05-18 18:08:51 +00001// RUN: clang %s -fsyntax-only -verify -pedantic
2
Douglas Gregor4ec339f2009-01-19 19:26:10 +00003typedef struct S S; // expected-note{{forward declaration of 'struct S'}}
Eli Friedmand72d16e2008-05-18 18:08:51 +00004void a(S* b, void* c) {
5 b++; // expected-error {{arithmetic on pointer to incomplete type}}
6 b += 1; // expected-error {{arithmetic on pointer to incomplete type}}
7 c++; // expected-warning {{use of GNU void* extension}}
8 c += 1; // expected-warning {{use of GNU void* extension}}
9 b = 1+b; // expected-error {{arithmetic on pointer to incomplete type}}
10 /* The next couple tests are only pedantic warnings in gcc */
11 void (*d)(S*,void*) = a;
Douglas Gregor4ec339f2009-01-19 19:26:10 +000012 d += 1; // expected-error {{arithmetic on pointer to function type}}}
13 d++; // expected-error {{arithmetic on pointer to function type}}}
Eli Friedmand72d16e2008-05-18 18:08:51 +000014}