+2012-05-12 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * doc/generic.texi: Rename TYPE_PTRMEM_P to TYPE_PTRDATAMEM_P.
+
2012-05-12 Uros Bizjak <ubizjak@gmail.com>
* config/alpha/alpha.c (alpha_emit_conditional_branch): Handle
+2012-05-12 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * cp-tree.h (TYPE_PTRMEM_P): Rename to TYPE_PTRDATAMEM_P.
+ (TYPE_PTR_TO_MEMBER_P): Rename to TYPE_PTRMEM_P.
+ (TYPE_PTR_OR_PTRMEM_P): Add.
+ * typeck.c (composite_pointer_type_r, composite_pointer_type,
+ common_pointer_type, cp_build_indirect_ref, cp_build_binary_op,
+ cp_truthvalue_conversion, convert_ptrmem, build_static_cast_1,
+ build_reinterpret_cast_1, build_const_cast_1, comp_ptr_ttypes_real,
+ casts_away_constness_r, casts_away_constness): Adjust.
+ * init.c (build_zero_init_1): Adjust.
+ * class.c (check_field_decls): Likewise.
+ * decl.c (check_default_argument): Likewise.
+ * rtti.c (target_incomplete_p): Likewise.
+ * tree.c (zero_init_p): Likewise.
+ * cxx-pretty-print.c (pp_cxx_ptr_operator,
+ pp_cxx_abstract_declarator): Likewise.
+ * typeck2.c (build_m_component_ref): Likewise.
+ * pt.c (convert_nontype_argument, invalid_nontype_parm_type_p,
+ dependent_type_p_r): Likewise.
+ * call.c (null_member_pointer_value_p, standard_conversion,
+ add_builtin_candidate, build_conditional_expr_1, compare_ics):
+ Likewise.
+ * cp-objcp-common.c (cp_var_mod_type_p): Likewise.
+ * cvt.c (cp_convert_to_pointer, ocp_convert,
+ perform_qualification_conversions): Likewise.
+ * mangle.c (write_type): Likewise.
+ * name-lookup.c (arg_assoc_type): Likewise.
+
2012-05-12 Paolo Carlini <paolo.carlini@oracle.com>
* parser.c (struct cp_parser_expression_stack_entry): Add location_t
else if (TYPE_PTRMEMFUNC_P (type))
return (TREE_CODE (t) == CONSTRUCTOR
&& integer_zerop (CONSTRUCTOR_ELT (t, 0)->value));
- else if (TYPE_PTRMEM_P (type))
+ else if (TYPE_PTRDATAMEM_P (type))
return integer_all_onesp (t);
else
return false;
A null pointer constant can be converted to a pointer type; ... A
null pointer constant of integral type can be converted to an
rvalue of type std::nullptr_t. */
- if ((tcode == POINTER_TYPE || TYPE_PTR_TO_MEMBER_P (to)
+ if ((tcode == POINTER_TYPE || TYPE_PTRMEM_P (to)
|| NULLPTR_TYPE_P (to))
&& expr && null_ptr_cst_p (expr))
conv = build_conv (ck_std, to, conv);
conv->bad_p = true;
}
else if ((tcode == POINTER_TYPE && fcode == POINTER_TYPE)
- || (TYPE_PTRMEM_P (to) && TYPE_PTRMEM_P (from)))
+ || (TYPE_PTRDATAMEM_P (to) && TYPE_PTRDATAMEM_P (from)))
{
tree to_pointee;
tree from_pointee;
TREE_TYPE (to)))
;
else if (VOID_TYPE_P (TREE_TYPE (to))
- && !TYPE_PTRMEM_P (from)
+ && !TYPE_PTRDATAMEM_P (from)
&& TREE_CODE (TREE_TYPE (from)) != FUNCTION_TYPE)
{
tree nfrom = TREE_TYPE (from);
cp_type_quals (nfrom)));
conv = build_conv (ck_ptr, from, conv);
}
- else if (TYPE_PTRMEM_P (from))
+ else if (TYPE_PTRDATAMEM_P (from))
{
tree fbase = TYPE_PTRMEM_CLASS_TYPE (from);
tree tbase = TYPE_PTRMEM_CLASS_TYPE (to);
if (ARITHMETIC_TYPE_P (from)
|| UNSCOPED_ENUM_P (from)
|| fcode == POINTER_TYPE
- || TYPE_PTR_TO_MEMBER_P (from)
+ || TYPE_PTRMEM_P (from)
|| NULLPTR_TYPE_P (from))
{
conv = build_conv (ck_std, to, conv);
if (fcode == POINTER_TYPE
- || TYPE_PTRMEM_P (from)
+ || TYPE_PTRDATAMEM_P (from)
|| (TYPE_PTRMEMFUNC_P (from)
&& conv->rank < cr_pbool)
|| NULLPTR_TYPE_P (from))
case MEMBER_REF:
if (TREE_CODE (type1) == POINTER_TYPE
- && TYPE_PTR_TO_MEMBER_P (type2))
+ && TYPE_PTRMEM_P (type2))
{
tree c1 = TREE_TYPE (type1);
tree c2 = TYPE_PTRMEM_CLASS_TYPE (type2);
case EQ_EXPR:
case NE_EXPR:
if ((TYPE_PTRMEMFUNC_P (type1) && TYPE_PTRMEMFUNC_P (type2))
- || (TYPE_PTRMEM_P (type1) && TYPE_PTRMEM_P (type2)))
+ || (TYPE_PTRDATAMEM_P (type1) && TYPE_PTRDATAMEM_P (type2)))
break;
- if (TYPE_PTR_TO_MEMBER_P (type1) && null_ptr_cst_p (args[1]))
+ if (TYPE_PTRMEM_P (type1) && null_ptr_cst_p (args[1]))
{
type2 = type1;
break;
}
- if (TYPE_PTR_TO_MEMBER_P (type2) && null_ptr_cst_p (args[0]))
+ if (TYPE_PTRMEM_P (type2) && null_ptr_cst_p (args[0]))
{
type1 = type2;
break;
break;
if ((TYPE_PTRMEMFUNC_P (type1) && TYPE_PTRMEMFUNC_P (type2))
|| (TYPE_PTR_P (type1) && TYPE_PTR_P (type2))
- || (TYPE_PTRMEM_P (type1) && TYPE_PTRMEM_P (type2))
+ || (TYPE_PTRDATAMEM_P (type1) && TYPE_PTRDATAMEM_P (type2))
|| ((TYPE_PTRMEMFUNC_P (type1)
|| TREE_CODE (type1) == POINTER_TYPE)
&& null_ptr_cst_p (args[1])))
break;
/* Otherwise, the types should be pointers. */
- if (!(TYPE_PTR_P (type1) || TYPE_PTR_TO_MEMBER_P (type1))
- || !(TYPE_PTR_P (type2) || TYPE_PTR_TO_MEMBER_P (type2)))
+ if (!TYPE_PTR_OR_PTRMEM_P (type1) || !TYPE_PTR_OR_PTRMEM_P (type2))
return;
/* We don't check that the two types are the same; the logic
&& TREE_CODE (type1) == TREE_CODE (type2)
&& (TREE_CODE (type1) == REFERENCE_TYPE
|| (TYPE_PTR_P (type1) && TYPE_PTR_P (type2))
- || (TYPE_PTRMEM_P (type1) && TYPE_PTRMEM_P (type2))
+ || (TYPE_PTRDATAMEM_P (type1) && TYPE_PTRDATAMEM_P (type2))
|| TYPE_PTRMEMFUNC_P (type1)
|| MAYBE_CLASS_TYPE_P (type1)
|| TREE_CODE (type1) == ENUMERAL_TYPE))
{
- if (TYPE_PTR_P (type1) || TYPE_PTR_TO_MEMBER_P (type1))
+ if (TYPE_PTR_OR_PTRMEM_P (type1))
{
tree cptype = composite_pointer_type (type1, type2,
error_mark_node,
cv-qualification of either the second or the third operand.
The result is of the common type. */
else if ((null_ptr_cst_p (arg2)
- && (TYPE_PTR_P (arg3_type) || TYPE_PTR_TO_MEMBER_P (arg3_type)))
+ && TYPE_PTR_OR_PTRMEM_P (arg3_type))
|| (null_ptr_cst_p (arg3)
- && (TYPE_PTR_P (arg2_type) || TYPE_PTR_TO_MEMBER_P (arg2_type)))
+ && TYPE_PTR_OR_PTRMEM_P (arg2_type))
|| (TYPE_PTR_P (arg2_type) && TYPE_PTR_P (arg3_type))
- || (TYPE_PTRMEM_P (arg2_type) && TYPE_PTRMEM_P (arg3_type))
+ || (TYPE_PTRDATAMEM_P (arg2_type) && TYPE_PTRDATAMEM_P (arg3_type))
|| (TYPE_PTRMEMFUNC_P (arg2_type) && TYPE_PTRMEMFUNC_P (arg3_type)))
{
result_type = composite_pointer_type (arg2_type, arg3_type, arg2,
for pointers A*, except opposite: if B is derived from A then
A::* converts to B::*, not vice versa. For that reason, we
switch the from_ and to_ variables here. */
- else if ((TYPE_PTRMEM_P (from_type1) && TYPE_PTRMEM_P (from_type2)
- && TYPE_PTRMEM_P (to_type1) && TYPE_PTRMEM_P (to_type2))
+ else if ((TYPE_PTRDATAMEM_P (from_type1) && TYPE_PTRDATAMEM_P (from_type2)
+ && TYPE_PTRDATAMEM_P (to_type1) && TYPE_PTRDATAMEM_P (to_type2))
|| (TYPE_PTRMEMFUNC_P (from_type1)
&& TYPE_PTRMEMFUNC_P (from_type2)
&& TYPE_PTRMEMFUNC_P (to_type1)
to members which might hold dynamic memory. So do not warn
for pointers to functions or pointers to members. */
if (TYPE_PTR_P (type)
- && !TYPE_PTRFN_P (type)
- && !TYPE_PTR_TO_MEMBER_P (type))
+ && !TYPE_PTRFN_P (type))
has_pointers = true;
if (CLASS_TYPE_P (type))
/* Some code common to C++ and ObjC++ front ends.
- Copyright (C) 2004, 2007, 2008, 2009, 2010, 2011
+ Copyright (C) 2004, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Contributed by Ziemowit Laski <zlaski@apple.com>
{
/* If TYPE is a pointer-to-member, it is variably modified if either
the class or the member are variably modified. */
- if (TYPE_PTR_TO_MEMBER_P (type))
+ if (TYPE_PTRMEM_P (type))
return (variably_modified_type_p (TYPE_PTRMEM_CLASS_TYPE (type), fn)
|| variably_modified_type_p (TYPE_PTRMEM_POINTED_TO_TYPE (type),
fn));
Keep these checks in ascending code order. */
#define SCALAR_TYPE_P(TYPE) \
- (TYPE_PTRMEM_P (TYPE) \
+ (TYPE_PTRDATAMEM_P (TYPE) \
|| TREE_CODE (TYPE) == ENUMERAL_TYPE \
|| ARITHMETIC_TYPE_P (TYPE) \
|| TYPE_PTR_P (TYPE) \
(TYPE_HAS_COPY_ASSIGN (NODE) && ! TYPE_HAS_COMPLEX_COPY_ASSIGN (NODE))
/* Returns true if NODE is a pointer-to-data-member. */
-#define TYPE_PTRMEM_P(NODE) \
+#define TYPE_PTRDATAMEM_P(NODE) \
(TREE_CODE (NODE) == OFFSET_TYPE)
/* Returns true if NODE is a pointer. */
#define TYPE_PTR_P(NODE) \
(LANG_TYPE_CLASS_CHECK (NODE)->ptrmemfunc_flag)
/* Returns true if NODE is a pointer-to-member. */
-#define TYPE_PTR_TO_MEMBER_P(NODE) \
- (TYPE_PTRMEM_P (NODE) || TYPE_PTRMEMFUNC_P (NODE))
+#define TYPE_PTRMEM_P(NODE) \
+ (TYPE_PTRDATAMEM_P (NODE) || TYPE_PTRMEMFUNC_P (NODE))
+
+/* Returns true if NODE is a pointer or a pointer-to-member. */
+#define TYPE_PTR_OR_PTRMEM_P(NODE) \
+ (TYPE_PTR_P (NODE) || TYPE_PTRMEM_P (NODE))
/* Indicates when overload resolution may resolve to a pointer to
member function. [expr.unary.op]/3 */
TYPE_PTRMEM_POINTED_TO_TYPE; there, the first parameter will have
type `const X*'. */
#define TYPE_PTRMEM_CLASS_TYPE(NODE) \
- (TYPE_PTRMEM_P (NODE) \
+ (TYPE_PTRDATAMEM_P (NODE) \
? TYPE_OFFSET_BASETYPE (NODE) \
: TYPE_PTRMEMFUNC_OBJECT_TYPE (NODE))
/* For a pointer-to-member type of the form `T X::*', this is `T'. */
#define TYPE_PTRMEM_POINTED_TO_TYPE(NODE) \
- (TYPE_PTRMEM_P (NODE) \
+ (TYPE_PTRDATAMEM_P (NODE) \
? TREE_TYPE (NODE) \
: TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (NODE)))
return build_nop (type, expr);
}
- else if ((TYPE_PTRMEM_P (type) && TYPE_PTRMEM_P (intype))
+ else if ((TYPE_PTRDATAMEM_P (type) && TYPE_PTRDATAMEM_P (intype))
|| (TYPE_PTRMEMFUNC_P (type) && TYPE_PTRMEMFUNC_P (intype)))
return convert_ptrmem (type, expr, /*allow_inverse_p=*/false,
/*c_cast_p=*/false, tf_warning_or_error);
return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0,
/*c_cast_p=*/false, tf_warning_or_error);
- if (TYPE_PTRMEM_P (type))
+ if (TYPE_PTRDATAMEM_P (type))
{
/* A NULL pointer-to-member is represented by -1, not by
zero. */
return expr;
}
- else if (TYPE_PTR_TO_MEMBER_P (type) && INTEGRAL_CODE_P (form))
+ else if (TYPE_PTRMEM_P (type) && INTEGRAL_CODE_P (form))
{
error_at (loc, "invalid conversion from %qT to %qT", intype, type);
return error_mark_node;
}
if (NULLPTR_TYPE_P (type) && e && null_ptr_cst_p (e))
return nullptr_node;
- if (POINTER_TYPE_P (type) || TYPE_PTR_TO_MEMBER_P (type))
+ if (POINTER_TYPE_P (type) || TYPE_PTRMEM_P (type))
return fold_if_not_in_template (cp_convert_to_pointer (type, e));
if (code == VECTOR_TYPE)
{
else if (TYPE_PTR_P (type) && TYPE_PTR_P (expr_type)
&& comp_ptr_ttypes (TREE_TYPE (type), TREE_TYPE (expr_type)))
return build_nop (type, expr);
- else if (TYPE_PTR_TO_MEMBER_P (type)
- && TYPE_PTR_TO_MEMBER_P (expr_type)
+ else if (TYPE_PTRMEM_P (type) && TYPE_PTRMEM_P (expr_type)
&& same_type_p (TYPE_PTRMEM_CLASS_TYPE (type),
TYPE_PTRMEM_CLASS_TYPE (expr_type))
&& comp_ptr_ttypes (TYPE_PTRMEM_POINTED_TO_TYPE (type),
{
case REFERENCE_TYPE:
case POINTER_TYPE:
- if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE
- || TYPE_PTR_TO_MEMBER_P (TREE_TYPE (t)))
+ if (TYPE_PTR_OR_PTRMEM_P (TREE_TYPE (t)))
pp_cxx_ptr_operator (pp, TREE_TYPE (t));
pp_c_attributes_display (pp_c_base (pp),
TYPE_ATTRIBUTES (TREE_TYPE (t)));
break;
}
case OFFSET_TYPE:
- if (TYPE_PTR_TO_MEMBER_P (t))
+ if (TYPE_PTRMEM_P (t))
{
if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE)
pp_cxx_left_paren (pp);
static void
pp_cxx_abstract_declarator (cxx_pretty_printer *pp, tree t)
{
- if (TYPE_PTRMEM_P (t) || TYPE_PTRMEMFUNC_P (t))
+ if (TYPE_PTRMEM_P (t))
pp_cxx_right_paren (pp);
else if (POINTER_TYPE_P (t))
{
if (warn_zero_as_null_pointer_constant
&& c_inhibit_evaluation_warnings == 0
- && (TYPE_PTR_P (decl_type) || TYPE_PTR_TO_MEMBER_P (decl_type))
+ && TYPE_PTR_OR_PTRMEM_P (decl_type)
&& null_ptr_cst_p (arg)
&& !NULLPTR_TYPE_P (TREE_TYPE (arg)))
{
items with static storage duration that are not otherwise
initialized are initialized to zero. */
;
- else if (TYPE_PTR_P (type) || TYPE_PTR_TO_MEMBER_P (type))
+ else if (TYPE_PTR_OR_PTRMEM_P (type))
init = convert (type, nullptr_node);
else if (SCALAR_TYPE_P (type))
init = convert (type, integer_zero_node);
if (TREE_CODE (type) == RECORD_TYPE && TYPE_TRANSPARENT_AGGR (type))
type = TREE_TYPE (first_field (type));
- if (TYPE_PTRMEM_P (type))
+ if (TYPE_PTRDATAMEM_P (type))
write_pointer_to_member_type (type);
else
{
if (!type)
return false;
- if (TYPE_PTRMEM_P (type))
+ if (TYPE_PTRDATAMEM_P (type))
{
/* Pointer to member: associate class type and value type. */
if (arg_assoc_type (k, TYPE_PTRMEM_CLASS_TYPE (type)))
/* 14.3.2/5: The null pointer{,-to-member} conversion is applied
to a non-type argument of "nullptr". */
- if (expr == nullptr_node
- && (TYPE_PTR_P (type) || TYPE_PTR_TO_MEMBER_P (type)))
+ if (expr == nullptr_node && TYPE_PTR_OR_PTRMEM_P (type))
expr = convert (type, expr);
/* In C++11, integral or enumeration non-type template arguments can be
CONSTRUCTOR. */;
else if (INTEGRAL_OR_ENUMERATION_TYPE_P (type))
expr = maybe_constant_value (expr);
- else if (TYPE_PTR_P (type)
- || TYPE_PTR_TO_MEMBER_P (type))
+ else if (TYPE_PTR_OR_PTRMEM_P (type))
{
tree folded = maybe_constant_value (expr);
if (TYPE_PTR_P (type) ? integer_zerop (folded)
For a non-type template-parameter of type pointer to data member,
qualification conversions (_conv.qual_) are applied. */
- else if (TYPE_PTRMEM_P (type))
+ else if (TYPE_PTRDATAMEM_P (type))
{
/* [temp.arg.nontype] bullet 1 says the pointer to member
expression must be a pointer-to-member constant. */
return 0;
else if (POINTER_TYPE_P (type))
return 0;
- else if (TYPE_PTR_TO_MEMBER_P (type))
+ else if (TYPE_PTRMEM_P (type))
return 0;
else if (TREE_CODE (type) == TEMPLATE_TYPE_PARM)
return 0;
dependent. */
type = TYPE_MAIN_VARIANT (type);
/* -- a compound type constructed from any dependent type. */
- if (TYPE_PTR_TO_MEMBER_P (type))
+ if (TYPE_PTRMEM_P (type))
return (dependent_type_p (TYPE_PTRMEM_CLASS_TYPE (type))
|| dependent_type_p (TYPE_PTRMEM_POINTED_TO_TYPE
(type)));
target_incomplete_p (tree type)
{
while (true)
- if (TYPE_PTRMEM_P (type))
+ if (TYPE_PTRDATAMEM_P (type))
{
if (!COMPLETE_TYPE_P (TYPE_PTRMEM_CLASS_TYPE (type)))
return true;
return 1;
/* NULL pointers to data members are initialized with -1. */
- if (TYPE_PTRMEM_P (t))
+ if (TYPE_PTRDATAMEM_P (t))
return 0;
/* Classes that contain types that can't be zero-initialized, cannot
result_type = pointee1;
else if ((TREE_CODE (pointee1) == POINTER_TYPE
&& TREE_CODE (pointee2) == POINTER_TYPE)
- || (TYPE_PTR_TO_MEMBER_P (pointee1)
- && TYPE_PTR_TO_MEMBER_P (pointee2)))
+ || (TYPE_PTRMEM_P (pointee1) && TYPE_PTRMEM_P (pointee2)))
{
result_type = composite_pointer_type_r (pointee1, pointee2, operation,
complain);
| cp_type_quals (pointee2)));
/* If the original types were pointers to members, so is the
result. */
- if (TYPE_PTR_TO_MEMBER_P (t1))
+ if (TYPE_PTRMEM_P (t1))
{
if (!same_type_p (TYPE_PTRMEM_CLASS_TYPE (t1),
TYPE_PTRMEM_CLASS_TYPE (t2)))
}
/* [expr.eq] permits the application of a pointer-to-member
conversion to change the class type of one of the types. */
- else if (TYPE_PTR_TO_MEMBER_P (t1)
+ else if (TYPE_PTRMEM_P (t1)
&& !same_type_p (TYPE_PTRMEM_CLASS_TYPE (t1),
TYPE_PTRMEM_CLASS_TYPE (t2)))
{
common_pointer_type (tree t1, tree t2)
{
gcc_assert ((TYPE_PTR_P (t1) && TYPE_PTR_P (t2))
- || (TYPE_PTRMEM_P (t1) && TYPE_PTRMEM_P (t2))
+ || (TYPE_PTRDATAMEM_P (t1) && TYPE_PTRDATAMEM_P (t2))
|| (TYPE_PTRMEMFUNC_P (t1) && TYPE_PTRMEMFUNC_P (t2)));
return composite_pointer_type (t1, t2, error_mark_node, error_mark_node,
;
/* `pointer' won't be an error_mark_node if we were given a
pointer to member, so it's cool to check for this here. */
- else if (TYPE_PTR_TO_MEMBER_P (type))
+ else if (TYPE_PTRMEM_P (type))
switch (errorstring)
{
case RO_ARRAY_INDEXING:
&& code != EQ_EXPR && code != NE_EXPR && code != MINUS_EXPR)
/* Or if one of OP0 or OP1 is neither a pointer nor NULL. */
|| (!null_ptr_cst_p (orig_op0)
- && !TYPE_PTR_P (type0) && !TYPE_PTR_TO_MEMBER_P (type0))
+ && !TYPE_PTR_OR_PTRMEM_P (type0))
|| (!null_ptr_cst_p (orig_op1)
- && !TYPE_PTR_P (type1) && !TYPE_PTR_TO_MEMBER_P (type1)))
+ && !TYPE_PTR_OR_PTRMEM_P (type1)))
&& (complain & tf_warning))
{
source_location loc =
|| code1 == COMPLEX_TYPE || code1 == ENUMERAL_TYPE))
short_compare = 1;
else if ((code0 == POINTER_TYPE && code1 == POINTER_TYPE)
- || (TYPE_PTRMEM_P (type0) && TYPE_PTRMEM_P (type1)))
+ || (TYPE_PTRDATAMEM_P (type0) && TYPE_PTRDATAMEM_P (type1)))
result_type = composite_pointer_type (type0, type1, op0, op1,
CPO_COMPARISON, complain);
- else if ((code0 == POINTER_TYPE || TYPE_PTRMEM_P (type0))
+ else if ((code0 == POINTER_TYPE || TYPE_PTRDATAMEM_P (type0))
&& null_ptr_cst_p (op1))
{
if (TREE_CODE (op0) == ADDR_EXPR
}
result_type = type0;
}
- else if ((code1 == POINTER_TYPE || TYPE_PTRMEM_P (type1))
+ else if ((code1 == POINTER_TYPE || TYPE_PTRDATAMEM_P (type1))
&& null_ptr_cst_p (op0))
{
if (TREE_CODE (op1) == ADDR_EXPR
cp_truthvalue_conversion (tree expr)
{
tree type = TREE_TYPE (expr);
- if (TYPE_PTRMEM_P (type))
+ if (TYPE_PTRDATAMEM_P (type))
return build_binary_op (EXPR_LOCATION (expr),
NE_EXPR, expr, nullptr_node, 1);
else if (TYPE_PTR_P (type) || TYPE_PTRMEMFUNC_P (type))
convert_ptrmem (tree type, tree expr, bool allow_inverse_p,
bool c_cast_p, tsubst_flags_t complain)
{
- if (TYPE_PTRMEM_P (type))
+ if (TYPE_PTRDATAMEM_P (type))
{
tree delta;
return cp_fold_convert(type, expr);
}
- if ((TYPE_PTRMEM_P (type) && TYPE_PTRMEM_P (intype))
+ if ((TYPE_PTRDATAMEM_P (type) && TYPE_PTRDATAMEM_P (intype))
|| (TYPE_PTRMEMFUNC_P (type) && TYPE_PTRMEMFUNC_P (intype)))
{
tree c1;
c1 = TYPE_PTRMEM_CLASS_TYPE (intype);
c2 = TYPE_PTRMEM_CLASS_TYPE (type);
- if (TYPE_PTRMEM_P (type))
+ if (TYPE_PTRDATAMEM_P (type))
{
t1 = (build_ptrmem_type
(c1,
/* OK */
;
else if ((INTEGRAL_OR_ENUMERATION_TYPE_P (type)
- || TYPE_PTR_P (type) || TYPE_PTR_TO_MEMBER_P (type))
+ || TYPE_PTR_OR_PTRMEM_P (type))
&& same_type_p (type, intype))
/* DR 799 */
return fold_if_not_in_template (build_nop (type, expr));
else if ((TYPE_PTRFN_P (type) && TYPE_PTRFN_P (intype))
|| (TYPE_PTRMEMFUNC_P (type) && TYPE_PTRMEMFUNC_P (intype)))
return fold_if_not_in_template (build_nop (type, expr));
- else if ((TYPE_PTRMEM_P (type) && TYPE_PTRMEM_P (intype))
+ else if ((TYPE_PTRDATAMEM_P (type) && TYPE_PTRDATAMEM_P (intype))
|| (TYPE_PTROBV_P (type) && TYPE_PTROBV_P (intype)))
{
tree sexpr = expr;
if (valid_p)
*valid_p = false;
- if (!POINTER_TYPE_P (dst_type) && !TYPE_PTRMEM_P (dst_type))
+ if (!POINTER_TYPE_P (dst_type) && !TYPE_PTRDATAMEM_P (dst_type))
{
if (complain & tf_error)
error ("invalid use of const_cast with type %qT, "
return error_mark_node;
}
- if (TYPE_PTR_P (src_type) || TYPE_PTRMEM_P (src_type))
+ if (TYPE_PTR_P (src_type) || TYPE_PTRDATAMEM_P (src_type))
{
if (comp_ptr_ttypes_const (dst_type, src_type))
{
if (TREE_CODE (to) == VECTOR_TYPE)
is_opaque_pointer = vector_targets_convertible_p (to, from);
- if (TREE_CODE (to) != POINTER_TYPE && !TYPE_PTRMEM_P (to))
+ if (TREE_CODE (to) != POINTER_TYPE && !TYPE_PTRDATAMEM_P (to))
return ((constp >= 0 || to_more_cv_qualified)
&& (is_opaque_pointer
|| same_type_ignoring_top_level_qualifiers_p (to, from)));
to
Tcv2,(M-K+1) * cv2,(M-K+2) * ... cv2,M *. */
- if ((!TYPE_PTR_P (*t1) && !TYPE_PTRMEM_P (*t1))
- || (!TYPE_PTR_P (*t2) && !TYPE_PTRMEM_P (*t2)))
+ if ((!TYPE_PTR_P (*t1) && !TYPE_PTRDATAMEM_P (*t1))
+ || (!TYPE_PTR_P (*t2) && !TYPE_PTRDATAMEM_P (*t2)))
{
*t1 = cp_build_qualified_type (void_type_node,
cp_type_quals (*t1));
quals1 = cp_type_quals (*t1);
quals2 = cp_type_quals (*t2);
- if (TYPE_PTRMEM_P (*t1))
+ if (TYPE_PTRDATAMEM_P (*t1))
*t1 = TYPE_PTRMEM_POINTED_TO_TYPE (*t1);
else
*t1 = TREE_TYPE (*t1);
- if (TYPE_PTRMEM_P (*t2))
+ if (TYPE_PTRDATAMEM_P (*t2))
*t2 = TYPE_PTRMEM_POINTED_TO_TYPE (*t2);
else
*t2 = TREE_TYPE (*t2);
complain);
}
- if (TYPE_PTRMEM_P (t1) && TYPE_PTRMEM_P (t2))
+ if (TYPE_PTRDATAMEM_P (t1) && TYPE_PTRDATAMEM_P (t2))
/* [expr.const.cast]
Casting from an rvalue of type "pointer to data member of X
component = mark_rvalue_use (component);
ptrmem_type = TREE_TYPE (component);
- if (!TYPE_PTR_TO_MEMBER_P (ptrmem_type))
+ if (!TYPE_PTRMEM_P (ptrmem_type))
{
if (complain & tf_error)
error ("%qE cannot be used as a member pointer, since it is of "
return error_mark_node;
}
- if (TYPE_PTRMEM_P (ptrmem_type))
+ if (TYPE_PTRDATAMEM_P (ptrmem_type))
{
bool is_lval = real_lvalue_p (datum);
tree ptype;