Skip to content
Snippets Groups Projects
Commit 0a72704b authored by Mark Mitchell's avatar Mark Mitchell Committed by Mark Mitchell
Browse files

re PR c++/11431 (static_cast behavior with subclasses when default constructor available)

	PR c++/11431
	* typeck.c (build_static_cast): Check for reference conversions
	earlier.

	* cp-tree.h (perform_integral_promotions): Declare.
	* call.c (build_addr_func): Use decay_conversion.
	(convert_arg_to_ellipsis): Likewise.  Remove misleading comment.
	(convert_for_arg_passing): Use perform_integral_promotions.
	* cvt.c (build_expr_type_conversion): Use decay_conversion.
	(type_promotes_to): Do not return a cv-qualified type.
	* decl.c (grok_reference_init): Fix formatting.
	(get_atexit_node): Use decay_conversion.
	(build_enumerator): Use perform_integral_promotions.
	* init.c (build_vec_init): Use decay_conversion.
	* semantics.c (finish_expr_stmt): Likewise.
	(finish_switch_cond): Use perform_integral_promotions.
	* typeck.c (default_conversion): Likewise.
	(perform_integral_promotions): New function.
	(build_indirect_ref): Use decay_conversion.
	(build_array_ref): Use perform_integral_promotions.
	(convert_arguments): Use decay_conversion.
	(build_unary_op): Use perform_integral_promotions.
	(build_c_cast): Use decay_conversion.
	(build_modify_expr): Likewise.
	(convert_for_initialization): Likewise.
	* typeck2.c (build_x_arrow): Likewise.

	* g++.old-deja/g++.jason/typeid1.C: Make it a compile test, not a
	run test.

	PR c++/11431
	* g++.dg/expr/static_cast3.C: New test.

From-SVN: r68989
parent ac3d7b44
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment