From f5d40bf94ac1d1d281d50fa12aeb2b7b8d7aaf9d Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 20 Jun 2013 18:53:38 +0000 Subject: [PATCH] Add an additional test for dynamic_cast. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184454 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/SemaCXX/dynamic-cast.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/SemaCXX/dynamic-cast.cpp b/test/SemaCXX/dynamic-cast.cpp index b73e8c57b9..b605194ecd 100644 --- a/test/SemaCXX/dynamic-cast.cpp +++ b/test/SemaCXX/dynamic-cast.cpp @@ -37,6 +37,8 @@ void basic_bad() (void)dynamic_cast((A*)0); // expected-error {{'Incomplete' is an incomplete type}} // incomplete -> ptr (void)dynamic_cast((Incomplete*)0); // expected-error {{'Incomplete' is an incomplete type}} + // rvalue -> lvalue + (void)dynamic_cast(A()); // expected-error {{dynamic_cast from rvalue to reference type 'A &'}} } void same() -- 2.40.0