Commit 2c1be322 by Jakub Jelinek Committed by Jakub Jelinek

call.c (convert_like_real): Create a temporary for non-lvalue.

	* call.c (convert_like_real): Create a temporary for non-lvalue.

	* g++.old-deja/g++.other/init16.C: Update the test so that it does
	not need <string> and also tests the initialization at runtime.

From-SVN: r39776
parent f5bbdc0c
2001-02-16 Jakub Jelinek <jakub@redhat.com>
* call.c (convert_like_real): Create a temporary for non-lvalue.
2001-02-16 Jeffrey Oldham <oldham@codesourcery.com>
* cp-tree.h: Fix typos in comments.
......
......@@ -3850,7 +3850,7 @@ convert_like_real (convs, expr, fn, argnum, inner)
tree ref_type = totype;
/* If necessary, create a temporary. */
if (NEED_TEMPORARY_P (convs))
if (NEED_TEMPORARY_P (convs) || !lvalue_p (expr))
{
tree type = TREE_TYPE (TREE_OPERAND (convs, 0));
expr = build_target_expr_with_type (expr, type);
......
2001-02-16 Jakub Jelinek <jakub@redhat.com>
* g++.old-deja/g++.other/init16.C: Update the test so that it does
not need <string> and also tests the initialization at runtime.
2001-02-16 Neil Booth <neil@daikokuya.demon.co.uk>
* gcc.c-torture/execute/longlong.c: New test.
......
// Build don't link:
// Origin: Jakub Jelinek <jakub@redhat.com>
// excess errors test - XFAIL *-*-*
#include <string>
struct bar {
char c;
bar (const char *);
bar (const bar &);
};
struct foo {
string x;
bar x;
};
extern const struct foo y = { "foo" };
bar::bar (const bar &ref)
{
c = ref.c;
}
bar::bar (const char *p)
{
c = p[2];
}
int main ()
{
return y.x.c != 'o';
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment