blob: d34bda54986c8158d967c474fc7b777a50c5c9eb [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Eli Friedman21bab842009-03-22 22:03:03 +00002
3struct foo; // expected-note 3 {{forward declaration of 'struct foo'}}
4
Anders Carlsson8c8d9192009-10-09 23:51:55 +00005struct foo a(); // expected-note {{'a' declared here}}
Eli Friedman21bab842009-03-22 22:03:03 +00006void b(struct foo);
7void c();
8
Argyrios Kyrtzidis8a285ae2011-04-26 17:41:22 +00009void func(void *p) {
Anders Carlsson8c8d9192009-10-09 23:51:55 +000010 a(); // expected-error{{calling 'a' with incomplete return type 'struct foo'}}
Argyrios Kyrtzidis8a285ae2011-04-26 17:41:22 +000011 b(*(struct foo*)p); // expected-error{{argument type 'struct foo' is incomplete}}
12 c(*(struct foo*)p); // expected-error{{argument type 'struct foo' is incomplete}}
Eli Friedman21bab842009-03-22 22:03:03 +000013}