This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bitfield conversion bug in 4.2?
Eric Lemings wrote:
test.cpp: In function 'int main()':
test02.cpp:6: error: could not convert 's.S::v' to 'bool'
test02.cpp:6: error: in arguument to unary !
As per my gcc-bugs message. I suggest this untested patch.
--
Jim Wilson, GNU Tools Support, http://www.specifix.com
2007-03-19 Jim Wilson <wilson@>
* call.c (standard_conversion): Set fcode after call to
strip_top_quals.
Index: call.c
===================================================================
--- call.c (revision 123071)
+++ call.c (working copy)
@@ -632,7 +632,10 @@
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);
}