This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22132] [4.0/4.1 Regression] Wrong code: upcasting a const class pointer to struct the class derives from (C/old-style cast)
- From: "cvs-commit at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jul 2005 16:10:16 -0000
- Subject: [Bug c++/22132] [4.0/4.1 Regression] Wrong code: upcasting a const class pointer to struct the class derives from (C/old-style cast)
- References: <20050621013546.22132.scott.tupaj@line6.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-07-15 16:10 -------
Subject: Bug 22132
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: mmitchel@gcc.gnu.org 2005-07-15 16:10:08
Modified files:
gcc/testsuite : ChangeLog
gcc/cp : ChangeLog call.c cp-tree.h typeck.c
Added files:
gcc/testsuite/g++.dg/expr: cast4.C
Log message:
PR c++/22132
* call.c (implicit_conversion): Add c_cast_p parameter.
(standard_conversion): Likewise. Allow conversions between
differently-qualified pointer types when performing a C-style
cast.
(add_function_candidate): Adjust callee.
(build_builtin_candidate): Likewise.
(build_user_type_conversion_1): Likewise.
(conditional_conversion): Likewise.
(can_convert_arg): Likewise.
(can_convert_arg_bad): Likewise.
(perform_implicit_conversion): Likewise.
* cp-tree.h (comp_ptr_ttypes_const): Declare.
* typeck.c (comp_ptr_ttypes_const): Give it external linkage.
Return bool.
PR c++/22132
* g++.dg/expr/cast4.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5771&r2=1.5772
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/expr/cast4.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4819&r2=1.4820
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.543&r2=1.544
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.1153&r2=1.1154
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.642&r2=1.643
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22132