From 9771799c29d553ad28453dd5bf2e72d6be593531 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 31 Jul 2009 22:26:21 -0400 Subject: call.c (reference_binding): Rename lvalue_p to is_lvalue. * call.c (reference_binding): Rename lvalue_p to is_lvalue. Do direct binding of "rvalues" in memory to rvalue references. * tree.c (lvalue_p_1): Can't be both non-addressable lvalue and "rvalue" in memory. * typeck.c (build_static_cast_1): Do direct binding of memory "rvalues" to rvalue references. * cvt.c (cp_fold_convert): New. * cp-tree.h: Declare it. From-SVN: r150325 --- gcc/cp/cvt.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gcc/cp/cvt.c') diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index c42d21c..cdc6a10 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -539,7 +539,16 @@ force_rvalue (tree expr) return expr; } + +/* Fold away simple conversions, but make sure the result is an rvalue. */ + +tree +cp_fold_convert (tree type, tree expr) +{ + return rvalue (fold_convert (type, expr)); +} + /* C++ conversions, preference to static cast conversions. */ tree -- cgit v1.1