mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-22 06:39:08 +08:00
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
This commit is contained in:
parent
f5bbdc0c54
commit
2c1be3223f
@ -1,3 +1,7 @@
|
||||
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);
|
||||
|
@ -1,3 +1,8 @@
|
||||
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.
|
||||
|
@ -1,11 +1,28 @@
|
||||
// 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';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user