]> granicus.if.org Git - clang/commitdiff
Add another test.
authorAnders Carlsson <andersca@mac.com>
Fri, 9 Oct 2009 23:58:25 +0000 (23:58 +0000)
committerAnders Carlsson <andersca@mac.com>
Fri, 9 Oct 2009 23:58:25 +0000 (23:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83693 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/incomplete-call.cpp [new file with mode: 0644]

diff --git a/test/SemaCXX/incomplete-call.cpp b/test/SemaCXX/incomplete-call.cpp
new file mode 100644 (file)
index 0000000..defc851
--- /dev/null
@@ -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'}}  
+}