diff options
author | Mark Mitchell <mark@codesourcery.com> | 2004-10-21 21:23:42 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2004-10-21 21:23:42 +0000 |
commit | 08e17d9d1121f0ce5869ddf1283db2449a4bc458 (patch) | |
tree | f2b7fac0767818e1f51fd05dc1e3af743cc2df4b /gcc/cp/cvt.c | |
parent | 8265f931175625977cb6ad5191a2ae286f71002e (diff) | |
download | gcc-08e17d9d1121f0ce5869ddf1283db2449a4bc458.zip gcc-08e17d9d1121f0ce5869ddf1283db2449a4bc458.tar.gz gcc-08e17d9d1121f0ce5869ddf1283db2449a4bc458.tar.bz2 |
re PR c++/18073 (mmintrin.h rejected by C++ frontend)
PR c++/18073
PR c++/10841
* cp-tree.h (convert_to_base): Change prototype.
(build_ptrmemfunc): Likewise.
(convert_ptrmem): New function.
* call.c (struct conversion): Adjust documentation for base_p.
(standard_conversion): Set base_p for ck_pmem conversions as
appropriate.
(convert_like_real): Use convert_to_base for ck_pmem and ck_ptr
conversions.
* class.c (convert_to_base): Handle both pointers and objects.
Add nonnull parameter.
(build_vfield_ref): Adjust call to convert_to_base.
* cvt.c (cp_convert_to_pointer): Adjust call to build_ptrmemfunc.
(convert_force): Likewise.
* typeck.c (build_unary_op): Likewise.
(convert_ptrmem): New function.
(build_static_cast_1): Use it.
(build_reinterpret_cast): Allow conversions to vector types.
(get_delta_difference): Add c_cast_p parameter.
(build_ptrmemfunc): Likewise. Adjust calls to
get_delta_difference.
PR c++/10841
* g++.dg/conversion/cast1.C: New test.
* g++.dg/overload/pmf1.C: Adjust error marker.
From-SVN: r89403
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r-- | gcc/cp/cvt.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 0223030..7f0f64c 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -217,7 +217,8 @@ cp_convert_to_pointer (tree type, tree expr, bool force) return build_nop (type, expr); } else if (TYPE_PTRMEMFUNC_P (type) && TYPE_PTRMEMFUNC_P (intype)) - return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0); + return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0, + /*c_cast_p=*/false); else if (TYPE_PTRMEMFUNC_P (intype)) { if (!warn_pmf2ptr) @@ -241,7 +242,8 @@ cp_convert_to_pointer (tree type, tree expr, bool force) if (integer_zerop (expr)) { if (TYPE_PTRMEMFUNC_P (type)) - return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0); + return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0, + /*c_cast_p=*/false); if (TYPE_PTRMEM_P (type)) { @@ -960,10 +962,9 @@ convert_force (tree type, tree expr, int convtype) || integer_zerop (e) || TYPE_PTRMEMFUNC_P (TREE_TYPE (e))) && TYPE_PTRMEMFUNC_P (type)) - { - /* compatible pointer to member functions. */ - return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), e, 1); - } + /* compatible pointer to member functions. */ + return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), e, 1, + /*c_cast_p=*/1); return ocp_convert (type, e, CONV_C_CAST|convtype, LOOKUP_NORMAL); } |