]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c++/14230 (ICE in cp_expr_size)
authorGabriel Dos Reis <gdr@integrable-solutions.net>
Sat, 13 Mar 2004 02:00:57 +0000 (02:00 +0000)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Sat, 13 Mar 2004 02:00:57 +0000 (02:00 +0000)
Backport:
2004-03-09  Mark Mitchell  <mark@codesourcery.com>
        PR c++/14230
        * call.c (initialize_reference): Handle initializers that are
        class-member access expressions applies to rvalues.

From-SVN: r79425

gcc/cp/ChangeLog
gcc/cp/call.c

index 3025fdd3e5e5e5b0303705ed64f4d18c45f21546..762f1472b19d6421ea0d86ba234bf0b95fdd84f4 100644 (file)
@@ -1,3 +1,11 @@
+2004-03-12  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+
+       Backport:
+       2004-03-09  Mark Mitchell  <mark@codesourcery.com>
+        PR c++/14230
+        * call.c (initialize_reference): Handle initializers that are
+        class-member access expressions applies to rvalues.
+
 2004-03-12  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
        Backport:
index a8e4457f15a1964f749c72405a764ed04e5c1d39..e45d5aaee0cca689ddab316906bae436d209bbde 100644 (file)
@@ -6204,6 +6204,16 @@ initialize_reference (type, expr, decl, cleanup)
          type = TREE_TYPE (expr);
          var = make_temporary_var_for_ref_to_temp (decl, type);
          layout_decl (var, 0);
+         /* If the rvalue is the result of a function call it will be
+            a TARGET_EXPR.  If it is some other construct (such as a
+            member access expression where the underlying object is
+            itself the result of a function call), turn it into a
+            TARGET_EXPR here.  It is important that EXPR be a
+            TARGET_EXPR below since otherwise the INIT_EXPR will
+            attempt to make a bitwise copy of EXPR to intialize
+            VAR. */
+         if (TREE_CODE (expr) != TARGET_EXPR)
+           expr = get_target_expr (expr);
          /* Create the INIT_EXPR that will initialize the temporary
             variable.  */
          init = build (INIT_EXPR, type, var, expr);