From: Anders Carlsson Date: Fri, 9 Oct 2009 23:58:25 +0000 (+0000) Subject: Add another test. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=11582f542e183f7a7dfcba82cc4378f42d1527c2;p=clang Add another test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83693 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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'}} +}