From 26b808448f313cd214311c371a9ea204c58ba66b Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 19 Mar 2012 17:55:11 +0000 Subject: [PATCH] Wuseless-cast.C: Extend. 2012-03-19 Paolo Carlini * g++.dg/warn/Wuseless-cast.C: Extend. From-SVN: r185531 --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/g++.dg/warn/Wuseless-cast.C | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1ec3774..ab0dd1d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2012-03-19 Paolo Carlini + * g++.dg/warn/Wuseless-cast.C: Extend. + +2012-03-19 Paolo Carlini + PR c++/14710 * g++.dg/warn/Wuseless-cast.C: New. diff --git a/gcc/testsuite/g++.dg/warn/Wuseless-cast.C b/gcc/testsuite/g++.dg/warn/Wuseless-cast.C index 8000d93..6f0e2cf 100644 --- a/gcc/testsuite/g++.dg/warn/Wuseless-cast.C +++ b/gcc/testsuite/g++.dg/warn/Wuseless-cast.C @@ -58,6 +58,8 @@ template dynamic_cast(t); } +A prvalue(); + void f() { int n; @@ -90,6 +92,10 @@ void f() #ifdef __GXX_EXPERIMENTAL_CXX0X__ (int&&)(42); static_cast(42); + + (A&&)(prvalue()); + const_cast(prvalue()); + static_cast(prvalue()); #endif A a; -- 2.7.4