aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorMark Mitchell <mmitchel@gcc.gnu.org>2007-03-23 04:31:21 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2007-03-23 04:31:21 +0000
commit725d6b877d6861a3075175c6620b6339f15eac6e (patch)
tree126f77adf19cf73399532dac19eca70e36c3b2a8 /gcc/cp
parent5a023baa1f8496c1c9c15f14d63e981331d8ea3a (diff)
downloadgcc-725d6b877d6861a3075175c6620b6339f15eac6e.zip
gcc-725d6b877d6861a3075175c6620b6339f15eac6e.tar.gz
gcc-725d6b877d6861a3075175c6620b6339f15eac6e.tar.bz2
Mark Mitchell <mark@codesourcery.com> PR c++/31273
Mark Mitchell <mark@codesourcery.com> PR c++/31273 * call.c (standard_conversion): Use type_decays_to. Keep FCODE consistent with FROM. PR c++/31273 * g++.dg/expr/bitfield7.C: New test. From-SVN: r123150
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/call.c15
2 files changed, 13 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 2a38123..3de84b6 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2007-03-22 Jim Wilson <wilson@specifix.com>
+ Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/31273
+ * call.c (standard_conversion): Use type_decays_to. Keep FCODE
+ consistent with FROM.
+
2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
* error.c (dump_expr): Handle dependent names that designate types.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 8218ed4..320e51c 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -636,15 +636,9 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
tcode = TREE_CODE (to);
conv = build_identity_conv (from, expr);
- if (fcode == FUNCTION_TYPE)
+ if (fcode == FUNCTION_TYPE || fcode == ARRAY_TYPE)
{
- from = build_pointer_type (from);
- fcode = TREE_CODE (from);
- conv = build_conv (ck_lvalue, from, conv);
- }
- else if (fcode == ARRAY_TYPE)
- {
- from = build_pointer_type (TREE_TYPE (from));
+ from = type_decays_to (from);
fcode = TREE_CODE (from);
conv = build_conv (ck_lvalue, from, conv);
}
@@ -655,7 +649,10 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
tree bitfield_type;
bitfield_type = is_bitfield_expr_with_lowered_type (expr);
if (bitfield_type)
- from = strip_top_quals (bitfield_type);
+ {
+ from = strip_top_quals (bitfield_type);
+ fcode = TREE_CODE (from);
+ }
}
conv = build_conv (ck_rvalue, from, conv);
}