blob: a9f49d206a1e71da137b01525a7f350a2cef7b54 [file] [log] [blame]
Anders Carlsson11582f52009-10-09 23:58:25 +00001// RUN: clang-cc -fsyntax-only -verify %s
Anders Carlssoncee1b542009-10-13 21:02:07 +00002struct A; // expected-note 6 {{forward declaration of 'struct A'}}
Anders Carlsson11582f52009-10-09 23:58:25 +00003
4A f(); // expected-note {{note: 'f' declared here}}
5
6struct B {
Anders Carlssoneed3e692009-10-10 00:06:20 +00007 A f(); // expected-note {{'f' declared here}}
Anders Carlssoncee1b542009-10-13 21:02:07 +00008 A operator()(); // expected-note {{'operator()' declared here}}
9 operator A(); // expected-note {{'operator A' declared here}}
Anders Carlsson11582f52009-10-09 23:58:25 +000010};
11
12void g() {
13 f(); // expected-error {{calling 'f' with incomplete return type 'struct A'}}
14
15 typedef A (*Func)();
16 Func fp;
17 fp(); // expected-error {{calling function with incomplete return type 'struct A'}}
18 ((Func)0)(); // expected-error {{calling function with incomplete return type 'struct A'}}
Anders Carlssoneed3e692009-10-10 00:06:20 +000019
20 B b;
21 b.f(); // expected-error {{calling 'f' with incomplete return type 'struct A'}}
Anders Carlssoncee1b542009-10-13 21:02:07 +000022
23 b.operator()(); // expected-error {{calling 'operator()' with incomplete return type 'struct A'}}
24 b.operator A(); // expected-error {{calling 'operator A' with incomplete return type 'struct A'}}
Anders Carlsson11582f52009-10-09 23:58:25 +000025}