]> git.ipfire.org Git - thirdparty/gcc.git/commit
re PR c++/11431 (static_cast behavior with subclasses when default constructor available)
authorMark Mitchell <mark@codesourcery.com>
Sun, 6 Jul 2003 03:30:57 +0000 (03:30 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 6 Jul 2003 03:30:57 +0000 (03:30 +0000)
commit0a72704b04e73d1173ae5e1c99464bea55a698b4
tree056d5a4f42966fc1a6672ee25eb4c64a77754dbf
parentac3d7b441379a5992280022a730eb5b1a57e0784
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
12 files changed:
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h
gcc/cp/cvt.c
gcc/cp/decl.c
gcc/cp/init.c
gcc/cp/semantics.c
gcc/cp/typeck.c
gcc/cp/typeck2.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/expr/static_cast3.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.jason/typeid1.C