re PR c++/22374 (C++ front-end produces mis-match types in MODIFY_EXPR (dynamic_cast))

2008-09-17  Richard Guenther  <rguenther@suse.de>

	PR c++/22374
	* rtti.c (build_dynamic_cast_1): Convert the COND_EXPR
	result to the correct type.

From-SVN: r140427
This commit is contained in:
Richard Guenther 2008-09-17 19:07:27 +00:00 committed by Richard Biener
parent 52a764acf7
commit c74147d2a9
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2008-09-17 Richard Guenther <rguenther@suse.de>
PR c++/22374
* rtti.c (build_dynamic_cast_1): Convert the COND_EXPR
result to the correct type.
2008-09-17 H.J. Lu <hongjiu.lu@intel.com>
PR c++/37450

View File

@ -722,7 +722,9 @@ build_dynamic_cast_1 (tree type, tree expr, tsubst_flags_t complain)
result = save_expr (result);
neq = c_common_truthvalue_conversion (result);
return build3 (COND_EXPR, type, neq, result, bad);
return cp_convert (type,
build3 (COND_EXPR, TREE_TYPE (result),
neq, result, bad));
}
/* Now back to the type we want from a void*. */