diff options
author | Mark Mitchell <mark@codesourcery.com> | 2006-04-28 02:40:58 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2006-04-28 02:40:58 +0000 |
commit | 33a1b314e5bf76d77eb3d5f130d4a43a6499d8c2 (patch) | |
tree | 89011bc674059b1f753d7dcb509a311ee72ff7b4 /gcc/cp | |
parent | 6a0ca517a3d9c6e1213e534b3dde795f9d7556b4 (diff) | |
download | gcc-33a1b314e5bf76d77eb3d5f130d4a43a6499d8c2.zip gcc-33a1b314e5bf76d77eb3d5f130d4a43a6499d8c2.tar.gz gcc-33a1b314e5bf76d77eb3d5f130d4a43a6499d8c2.tar.bz2 |
re PR c++/27292 (ICE on casts on bitfields)
PR c++/27292
* tree.c (rvalue): Convert bitfields to their declared types.
PR c++/27292
* g++.dg/conversion/bitfield4.C: New test.
From-SVN: r113339
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 aece2e8..17e3b29 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 a956205..60ba13f 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. */ |