From: Eli Friedman Date: Thu, 20 Jun 2013 01:47:05 +0000 (+0000) Subject: One more cast test. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d7abe109df5b169fe36d78915b5c0a5a4e6c2650;p=clang One more cast test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184393 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/SemaTemplate/virtual-member-functions.cpp b/test/SemaTemplate/virtual-member-functions.cpp index 6892278f77..439d8f836f 100644 --- a/test/SemaTemplate/virtual-member-functions.cpp +++ b/test/SemaTemplate/virtual-member-functions.cpp @@ -84,3 +84,15 @@ namespace PR7114 { xi.f(); } } + +namespace DynamicCast { + struct Y {}; + template struct X : virtual Y { + virtual void foo() { T x; } // expected-error {{variable has incomplete type 'void'}} + }; + template struct X2 : virtual Y { + virtual void foo() { T x; } + }; + Y* f(X* x) { return dynamic_cast(x); } // expected-note {{in instantiation of member function 'DynamicCast::X::foo' requested here}} + Y* f2(X* x) { return dynamic_cast(x); } +}