r184454 - Add an additional test for dynamic_cast.

Eli Friedman eli.friedman at gmail.com
Thu Jun 20 11:53:38 PDT 2013


Author: efriedma
Date: Thu Jun 20 13:53:38 2013
New Revision: 184454

URL: http://llvm.org/viewvc/llvm-project?rev=184454&view=rev
Log:
Add an additional test for dynamic_cast.


Modified:
    cfe/trunk/test/SemaCXX/dynamic-cast.cpp

Modified: cfe/trunk/test/SemaCXX/dynamic-cast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/dynamic-cast.cpp?rev=184454&r1=184453&r2=184454&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/dynamic-cast.cpp (original)
+++ cfe/trunk/test/SemaCXX/dynamic-cast.cpp Thu Jun 20 13:53:38 2013
@@ -37,6 +37,8 @@ void basic_bad()
   (void)dynamic_cast<Incomplete*>((A*)0); // expected-error {{'Incomplete' is an incomplete type}}
   // incomplete -> ptr
   (void)dynamic_cast<A*>((Incomplete*)0); // expected-error {{'Incomplete' is an incomplete type}}
+  // rvalue -> lvalue
+  (void)dynamic_cast<A&>(A()); // expected-error {{dynamic_cast from rvalue to reference type 'A &'}}
 }
 
 void same()





More information about the cfe-commits mailing list