Commit 2abda418 by Nathan Sidwell Committed by Nathan Sidwell

typeck.c (convert_for_assignment): Don't look at array initializer.

	* typeck.c (convert_for_assignment): Don't look at array
	initializer.
	* call.c (convert_like_real): Likewise.

From-SVN: r32415
parent 1c089156
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> 2000-03-07 Jason Merrill <jason@casey.cygnus.com>
Add initial support for '\uNNNN' specifier. Add initial support for '\uNNNN' specifier.
......
...@@ -3683,10 +3683,11 @@ convert_like_real (convs, expr, fn, argnum, inner) ...@@ -3683,10 +3683,11 @@ convert_like_real (convs, expr, fn, argnum, inner)
if (expr == error_mark_node) if (expr == error_mark_node)
return 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 are about to bind it to a reference, in which case we need to
leave it as an lvalue. */ 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); expr = decl_constant_value (expr);
switch (TREE_CODE (convs)) switch (TREE_CODE (convs))
......
...@@ -6523,7 +6523,7 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum) ...@@ -6523,7 +6523,7 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
/* Simplify the RHS if possible. */ /* Simplify the RHS if possible. */
if (TREE_CODE (rhs) == CONST_DECL) if (TREE_CODE (rhs) == CONST_DECL)
rhs = DECL_INITIAL (rhs); 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); rhs = decl_constant_value (rhs);
/* [expr.ass] /* [expr.ass]
......
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