From c4859baea4af6b2b5865c07aab4eb9089a8a9ae6 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sat, 10 Oct 2009 00:06:20 +0000 Subject: Check that the return type is complete when calling a member function. llvm-svn: 83694 --- clang/test/SemaCXX/incomplete-call.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'clang/test') 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'}} } -- cgit v1.2.3