Richard Smith | 9ca5c42 | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s |
Douglas Gregor | 465184a | 2011-01-22 00:06:57 +0000 | [diff] [blame] | 2 | |
| 3 | struct X { virtual ~X(); }; |
| 4 | struct Y : public X { }; |
| 5 | struct Z; // expected-note{{forward declaration of 'Z'}} |
| 6 | |
| 7 | void test(X &x, Y &y, Z &z) { |
| 8 | // If T is an rvalue reference type, v shall be an expression having |
| 9 | // a complete class type, and the result is an xvalue of the type |
| 10 | // referred to by T. |
| 11 | Y &&yr0 = dynamic_cast<Y&&>(x); |
| 12 | Y &&yr1 = dynamic_cast<Y&&>(static_cast<X&&>(x)); |
| 13 | Y &&yr2 = dynamic_cast<Y&&>(z); // expected-error{{'Z' is an incomplete type}} |
| 14 | } |