diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/tree.c | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index aece2e85da0..17e3b291c21 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2006-04-27 Mark Mitchell <mark@codesourcery.com> + PR c++/27292 + * tree.c (rvalue): Convert bitfields to their declared types. + PR c++/27102 * typeck2.c (cxx_incomplete_type_diagnostic): Handle TYPENAME_TYPE. diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index a956205a136..60ba13f9936 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -372,8 +372,9 @@ rvalue (tree expr) if (real_lvalue_p (expr)) { type = is_bitfield_expr_with_lowered_type (expr); - if (!type) - type = TREE_TYPE (expr); + if (type) + return cp_convert (TYPE_MAIN_VARIANT (type), expr); + type = TREE_TYPE (expr); /* [basic.lval] Non-class rvalues always have cv-unqualified types. */ |