This is the mail archive of the gcc-bugs@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]

[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)


------- 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


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