1*9ca5c425SRichard Smith // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s 2465184aeSDouglas Gregor 3465184aeSDouglas Gregor struct X { virtual ~X(); }; 4465184aeSDouglas Gregor struct Y : public X { }; 5465184aeSDouglas Gregor struct Z; // expected-note{{forward declaration of 'Z'}} 6465184aeSDouglas Gregor test(X & x,Y & y,Z & z)7465184aeSDouglas Gregorvoid test(X &x, Y &y, Z &z) { 8465184aeSDouglas Gregor // If T is an rvalue reference type, v shall be an expression having 9465184aeSDouglas Gregor // a complete class type, and the result is an xvalue of the type 10465184aeSDouglas Gregor // referred to by T. 11465184aeSDouglas Gregor Y &&yr0 = dynamic_cast<Y&&>(x); 12465184aeSDouglas Gregor Y &&yr1 = dynamic_cast<Y&&>(static_cast<X&&>(x)); 13465184aeSDouglas Gregor Y &&yr2 = dynamic_cast<Y&&>(z); // expected-error{{'Z' is an incomplete type}} 14465184aeSDouglas Gregor } 15