Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
Eli Friedman | 21bab84 | 2009-03-22 22:03:03 +0000 | [diff] [blame] | 2 | |
| 3 | struct foo; // expected-note 3 {{forward declaration of 'struct foo'}} |
| 4 | |
Anders Carlsson | 8c8d919 | 2009-10-09 23:51:55 +0000 | [diff] [blame] | 5 | struct foo a(); // expected-note {{'a' declared here}} |
Eli Friedman | 21bab84 | 2009-03-22 22:03:03 +0000 | [diff] [blame] | 6 | void b(struct foo); |
| 7 | void c(); |
| 8 | |
| 9 | void func() { |
Anders Carlsson | 8c8d919 | 2009-10-09 23:51:55 +0000 | [diff] [blame] | 10 | a(); // expected-error{{calling 'a' with incomplete return type 'struct foo'}} |
Eli Friedman | 21bab84 | 2009-03-22 22:03:03 +0000 | [diff] [blame] | 11 | b(*(struct foo*)0); // expected-error{{argument type 'struct foo' is incomplete}} |
| 12 | c(*(struct foo*)0); // expected-error{{argument type 'struct foo' is incomplete}} |
| 13 | } |