* 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
+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.
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';
+}