* call.c (standard_conversion): Use RVALUE_CONVs for all
expressions that satisfy lvalue_p, not just those that satisfy
real_lvalue_p.
From-SVN: r37013
2000-10-22 Mark Mitchell <mark@codesourcery.com>
+ * call.c (standard_conversion): Use RVALUE_CONVs for all
+ expressions that satisfy lvalue_p, not just those that satisfy
+ real_lvalue_p.
+
* optimize.c (copy_body_r): Don't treat CALL_EXPRs specially.
* typeck.c (c_sizeof): Return an expression of `size_t' type,
fcode = TREE_CODE (from);
conv = build_conv (LVALUE_CONV, from, conv);
}
- else if (fromref || (expr && real_lvalue_p (expr)))
+ else if (fromref || (expr && lvalue_p (expr)))
conv = build_conv (RVALUE_CONV, from, conv);
/* Allow conversion between `__complex__' data types */
--- /dev/null
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+extern "C" void abort ();
+
+int j;
+
+struct S {
+ S () { ++j; }
+ S (const S&) { ++j; }
+ ~S () {
+ if (--j < 0)
+ abort ();
+ }
+};
+
+struct T {
+ void g (S) {
+ };
+};
+
+struct U {
+ int i;
+ S s;
+};
+
+U u;
+
+U f () { return u; }
+
+int main ()
+{
+ T t;
+ t.g (f ().s);
+}