diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2000-03-08 10:26:06 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2000-03-08 10:26:06 +0000 |
commit | 2abda41888b697574683e355e92fe5cd40dff3c5 (patch) | |
tree | 8c8d2f64d47a8c4211dc28aa077aa9b9b7d8514d | |
parent | 1c08915645ab308eba6fb8a0ebd577539e3910b3 (diff) | |
download | gcc-2abda41888b697574683e355e92fe5cd40dff3c5.zip gcc-2abda41888b697574683e355e92fe5cd40dff3c5.tar.gz gcc-2abda41888b697574683e355e92fe5cd40dff3c5.tar.bz2 |
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
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/call.c | 5 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4b7c03c..948ea7d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 0589cfd..6e3eabd 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -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)) diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index a47b088..071d2ee 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -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] |