This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PR c++/35056] convert bitfield to target expr type for const& binding


Alexandre Oliva wrote:

Just as I posted the previous e-mail I saw your suggestion in
bugzilla, so I restarted testing using
convert_bitfield_to_declared_type() instead of fold_convert.

Thanks.


for  gcc/cp/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	PR c++/35056
	* tree.c: Include tree-flow.h.
	(build_target_expr): Check type compatibility.
	* Make-lang.in (cp/tree.o): Depend on $(TREE_FLOW_H).
	* call.c (convert_like_real): Convert bitfield to expected type.

for  gcc/testsuite/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	PR c++/35056
	* g++.dg/conversion/bitfield8.C: New.

This patch is OK. But, I too would suggest taking the assert out for 4.3 as well. I don't think we know that every time that assertion failures we have an actual demonstrable bug.


Technically, I don't think you need:

+ if (lvalue & clk_bitfield)

In other words, I think it would be OK to call c_b_t_d_t unconditionally, since it doesn't do anything for non-bitfields, but I also don't see a problem with your patch as-is.

Thanks,

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]