[cfe-commits] r67486 - /cfe/trunk/test/Sema/incomplete-call.c

Eli Friedman eli.friedman at gmail.com
Sun Mar 22 15:03:03 PDT 2009


Author: efriedma
Date: Sun Mar 22 17:03:03 2009
New Revision: 67486

URL: http://llvm.org/viewvc/llvm-project?rev=67486&view=rev
Log:
Add testcase for incomplete call/return types for calls.


Added:
    cfe/trunk/test/Sema/incomplete-call.c

Added: cfe/trunk/test/Sema/incomplete-call.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/incomplete-call.c?rev=67486&view=auto

==============================================================================
--- cfe/trunk/test/Sema/incomplete-call.c (added)
+++ cfe/trunk/test/Sema/incomplete-call.c Sun Mar 22 17:03:03 2009
@@ -0,0 +1,13 @@
+// RUN: clang -fsyntax-only -verify %s
+
+struct foo; // expected-note 3 {{forward declaration of 'struct foo'}}
+
+struct foo a();
+void b(struct foo);
+void c();
+
+void func() {
+  a(); // expected-error{{return type of called function ('struct foo') is incomplete}}
+  b(*(struct foo*)0); // expected-error{{argument type 'struct foo' is incomplete}}
+  c(*(struct foo*)0); // expected-error{{argument type 'struct foo' is incomplete}}
+}





More information about the cfe-commits mailing list