aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/SemaCXX/incomplete-call.cpp16
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'}}
+}