summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-10-10 00:06:20 +0000
committerAnders Carlsson <andersca@mac.com>2009-10-10 00:06:20 +0000
commitc4859baea4af6b2b5865c07aab4eb9089a8a9ae6 (patch)
tree6d2f6e06d508a238e249ad233f2a004ccefbfa3c /clang/test
parent1040f2e9dbf0110fdb283e2b1e736050d47c26d9 (diff)
downloadbcm5719-llvm-c4859baea4af6b2b5865c07aab4eb9089a8a9ae6.tar.gz
bcm5719-llvm-c4859baea4af6b2b5865c07aab4eb9089a8a9ae6.zip
Check that the return type is complete when calling a member function.
llvm-svn: 83694
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/incomplete-call.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/incomplete-call.cpp b/clang/test/SemaCXX/incomplete-call.cpp
index defc851bb4a..c61b61a9c64 100644
--- a/clang/test/SemaCXX/incomplete-call.cpp
+++ b/clang/test/SemaCXX/incomplete-call.cpp
@@ -1,9 +1,10 @@
// RUN: clang-cc -fsyntax-only -verify %s
-struct A; // expected-note 3 {{forward declaration of 'struct A'}}
+struct A; // expected-note 4 {{forward declaration of 'struct A'}}
A f(); // expected-note {{note: 'f' declared here}}
struct B {
+ A f(); // expected-note {{'f' declared here}}
};
void g() {
@@ -13,4 +14,7 @@ void g() {
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'}}
+
+ B b;
+ b.f(); // expected-error {{calling 'f' with incomplete return type 'struct A'}}
}
OpenPOWER on IntegriCloud