diff options
author | Mark Mitchell <mark@codesourcery.com> | 2005-07-15 16:10:05 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2005-07-15 16:10:05 +0000 |
commit | 34b5375faef75cab6ecda04f161e5b81f662b2cb (patch) | |
tree | 59867dcc10601c3cce82c828262ad523c4dfee3a /gcc/cp/cp-tree.h | |
parent | e27d6202c07dbc70172733fcf6e79cb2ffe9a56c (diff) | |
download | gcc-34b5375faef75cab6ecda04f161e5b81f662b2cb.zip gcc-34b5375faef75cab6ecda04f161e5b81f662b2cb.tar.gz gcc-34b5375faef75cab6ecda04f161e5b81f662b2cb.tar.bz2 |
re PR c++/22132 (Wrong code: upcasting a const class pointer to struct the class derives from (C/old-style cast))
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.
From-SVN: r102059
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r-- | gcc/cp/cp-tree.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index db70017..440bdff 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -4289,6 +4289,7 @@ extern tree build_modify_expr (tree, enum tree_code, tree); extern tree convert_for_initialization (tree, tree, tree, int, const char *, tree, int); extern int comp_ptr_ttypes (tree, tree); +extern bool comp_ptr_ttypes_const (tree, tree); extern int ptr_reasonably_similar (tree, tree); extern tree build_ptrmemfunc (tree, tree, int, bool); extern int cp_type_quals (tree); |