diff options
author | Anders Carlsson <andersca@mac.com> | 2009-10-09 23:58:25 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-10-09 23:58:25 +0000 |
commit | 11582f542e183f7a7dfcba82cc4378f42d1527c2 (patch) | |
tree | d4ff80e371e3bdae9c35d8e634ae530deb44fff7 | |
parent | 8c8d91917c307dc3ba4f60661377c745f2a6bef2 (diff) |
Add another test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83693 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/SemaCXX/incomplete-call.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/SemaCXX/incomplete-call.cpp b/test/SemaCXX/incomplete-call.cpp new file mode 100644 index 0000000000..defc851bb4 --- /dev/null +++ b/test/SemaCXX/incomplete-call.cpp @@ -0,0 +1,16 @@ +// RUN: clang-cc -fsyntax-only -verify %s +struct A; // expected-note 3 {{forward declaration of 'struct A'}} + +A f(); // expected-note {{note: 'f' declared here}} + +struct B { +}; + +void g() { + f(); // expected-error {{calling 'f' with incomplete return type 'struct A'}} + + typedef A (*Func)(); + Func fp; + fp(); // expected-error {{calling function with incomplete return type 'struct A'}} + ((Func)0)(); // expected-error {{calling function with incomplete return type 'struct A'}} +} |