diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2008-05-27 05:48:02 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2008-05-27 05:48:02 +0000 |
commit | bced83044966b9fdeef85a5207b94170bd83b2ba (patch) | |
tree | 3984c0b7cc29a396df3b6c7be3025ff0ca606abd /gcc/cp | |
parent | 48c655bb7552beb31369f1fac45c2a8732c8734b (diff) | |
download | gcc-bced83044966b9fdeef85a5207b94170bd83b2ba.zip gcc-bced83044966b9fdeef85a5207b94170bd83b2ba.tar.gz gcc-bced83044966b9fdeef85a5207b94170bd83b2ba.tar.bz2 |
re PR c++/35909 (ICE with bit-field and const references)
gcc/cp/ChangeLog:
PR c++/35909
* call.c (convert_like_real): Convert bitfield to desired type
before creating temporary.
gcc/testsuite/ChangeLog:
PR c++/35909
* g++.dg/conversion/bitfield9.C: New.
From-SVN: r135969
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/call.c | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4b1c7db..3c54503 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2008-05-27 Alexandre Oliva <aoliva@redhat.com> + + PR c++/35909 + * call.c (convert_like_real): Convert bitfield to desired type + before creating temporary. + 2008-05-26 Daniel Franke <franke.daniel@gmail.com> * Makefile.in: Adjusted dependencies on c-incpath.o. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index b83ad3a..fe78f9c 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -4580,7 +4580,10 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, return error_mark_node; } if (lvalue & clk_bitfield) - expr = convert_bitfield_to_declared_type (expr); + { + expr = convert_bitfield_to_declared_type (expr); + expr = fold_convert (type, expr); + } expr = build_target_expr_with_type (expr, type); } |