]> gcc.gnu.org Git - gcc.git/commitdiff
typeck.c (convert_for_assignment): Don't look at array initializer.
authorNathan Sidwell <nathan@codesourcery.com>
Wed, 8 Mar 2000 10:26:06 +0000 (10:26 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Wed, 8 Mar 2000 10:26:06 +0000 (10:26 +0000)
* typeck.c (convert_for_assignment): Don't look at array
initializer.
* call.c (convert_like_real): Likewise.

From-SVN: r32415

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

index 4b7c03c7ed5953d1a06a2ed544991bb871f1e5b7..948ea7dab59f2b3844bf4b4973b0c3ecb73c87c6 100644 (file)
@@ -1,3 +1,9 @@
+2000-03-08  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * typeck.c (convert_for_assignment): Don't look at array
+       initializer.
+       * call.c (convert_like_real): Likewise. 
+
 2000-03-07  Jason Merrill  <jason@casey.cygnus.com>
 
        Add initial support for '\uNNNN' specifier.
index 0589cfdcc9f1d5b482df836ab8fadb8ab5c1f899..6e3eabd1d31281657b91e9be8830b821cae90980 100644 (file)
@@ -3683,10 +3683,11 @@ convert_like_real (convs, expr, fn, argnum, inner)
   if (expr == error_mark_node)
     return error_mark_node;
 
-  /* Convert a constant variable to its underlying value, unless we
+  /* Convert a non-array constant variable to its underlying value, unless we
      are about to bind it to a reference, in which case we need to
      leave it as an lvalue.  */
-  if (TREE_READONLY_DECL_P (expr) && TREE_CODE (convs) != REF_BIND)
+  if (TREE_READONLY_DECL_P (expr) && TREE_CODE (convs) != REF_BIND
+      && TREE_CODE (TREE_TYPE (expr)) != ARRAY_TYPE)
     expr = decl_constant_value (expr);
 
   switch (TREE_CODE (convs))
index a47b088a44e2093d3d6d0f1482678590fe3f202b..071d2eef18f434e3537bea7e38ca72a5aad16adc 100644 (file)
@@ -6523,7 +6523,7 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
   /* Simplify the RHS if possible.  */
   if (TREE_CODE (rhs) == CONST_DECL)
     rhs = DECL_INITIAL (rhs);
-  else if (TREE_READONLY_DECL_P (rhs))
+  else if (TREE_READONLY_DECL_P (rhs) && coder != ARRAY_TYPE)
     rhs = decl_constant_value (rhs);
 
   /* [expr.ass]
This page took 0.083677 seconds and 5 git commands to generate.