]> granicus.if.org Git - clang/commitdiff
One more cast test.
authorEli Friedman <eli.friedman@gmail.com>
Thu, 20 Jun 2013 01:47:05 +0000 (01:47 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Thu, 20 Jun 2013 01:47:05 +0000 (01:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184393 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaTemplate/virtual-member-functions.cpp

index 6892278f7762bb2e9577b7cd5cbd677660d78f10..439d8f836f9fb3d38ba5db93fbe97b10af30842c 100644 (file)
@@ -84,3 +84,15 @@ namespace PR7114 {
     xi.f();
   }
 }
+
+namespace DynamicCast {
+  struct Y {};
+  template<typename T> struct X : virtual Y {
+    virtual void foo() { T x; } // expected-error {{variable has incomplete type 'void'}}
+  };
+  template<typename T> struct X2 : virtual Y {
+    virtual void foo() { T x; }
+  };
+  Y* f(X<void>* x) { return dynamic_cast<Y*>(x); } // expected-note {{in instantiation of member function 'DynamicCast::X<void>::foo' requested here}}
+  Y* f2(X<void>* x) { return dynamic_cast<Y*>(x); }
+}