generic.texi: Rename TYPE_PTRMEM_P to TYPE_PTRDATAMEM_P.

2012-05-12  Paolo Carlini  <paolo.carlini@oracle.com>

	* doc/generic.texi: Rename TYPE_PTRMEM_P to TYPE_PTRDATAMEM_P.

/cp
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.

From-SVN: r187425
This commit is contained in:
Paolo Carlini 2012-05-12 09:08:47 +00:00 committed by Paolo Carlini
parent 498ad15e8c
commit 66b1156afe
17 changed files with 111 additions and 81 deletions

View File

@ -1,3 +1,7 @@
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> 2012-05-12 Uros Bizjak <ubizjak@gmail.com>
* config/alpha/alpha.c (alpha_emit_conditional_branch): Handle * config/alpha/alpha.c (alpha_emit_conditional_branch): Handle

View File

@ -1,3 +1,32 @@
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> 2012-05-12 Paolo Carlini <paolo.carlini@oracle.com>
* parser.c (struct cp_parser_expression_stack_entry): Add location_t * parser.c (struct cp_parser_expression_stack_entry): Add location_t

View File

@ -578,7 +578,7 @@ null_member_pointer_value_p (tree t)
else if (TYPE_PTRMEMFUNC_P (type)) else if (TYPE_PTRMEMFUNC_P (type))
return (TREE_CODE (t) == CONSTRUCTOR return (TREE_CODE (t) == CONSTRUCTOR
&& integer_zerop (CONSTRUCTOR_ELT (t, 0)->value)); && integer_zerop (CONSTRUCTOR_ELT (t, 0)->value));
else if (TYPE_PTRMEM_P (type)) else if (TYPE_PTRDATAMEM_P (type))
return integer_all_onesp (t); return integer_all_onesp (t);
else else
return false; return false;
@ -1162,7 +1162,7 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
A null pointer constant can be converted to a pointer type; ... A A null pointer constant can be converted to a pointer type; ... A
null pointer constant of integral type can be converted to an null pointer constant of integral type can be converted to an
rvalue of type std::nullptr_t. */ 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)) || NULLPTR_TYPE_P (to))
&& expr && null_ptr_cst_p (expr)) && expr && null_ptr_cst_p (expr))
conv = build_conv (ck_std, to, conv); conv = build_conv (ck_std, to, conv);
@ -1182,7 +1182,7 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
conv->bad_p = true; conv->bad_p = true;
} }
else if ((tcode == POINTER_TYPE && fcode == POINTER_TYPE) 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 to_pointee;
tree from_pointee; tree from_pointee;
@ -1192,7 +1192,7 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
TREE_TYPE (to))) TREE_TYPE (to)))
; ;
else if (VOID_TYPE_P (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_CODE (TREE_TYPE (from)) != FUNCTION_TYPE)
{ {
tree nfrom = TREE_TYPE (from); tree nfrom = TREE_TYPE (from);
@ -1201,7 +1201,7 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
cp_type_quals (nfrom))); cp_type_quals (nfrom)));
conv = build_conv (ck_ptr, from, conv); 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 fbase = TYPE_PTRMEM_CLASS_TYPE (from);
tree tbase = TYPE_PTRMEM_CLASS_TYPE (to); tree tbase = TYPE_PTRMEM_CLASS_TYPE (to);
@ -1307,12 +1307,12 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
if (ARITHMETIC_TYPE_P (from) if (ARITHMETIC_TYPE_P (from)
|| UNSCOPED_ENUM_P (from) || UNSCOPED_ENUM_P (from)
|| fcode == POINTER_TYPE || fcode == POINTER_TYPE
|| TYPE_PTR_TO_MEMBER_P (from) || TYPE_PTRMEM_P (from)
|| NULLPTR_TYPE_P (from)) || NULLPTR_TYPE_P (from))
{ {
conv = build_conv (ck_std, to, conv); conv = build_conv (ck_std, to, conv);
if (fcode == POINTER_TYPE if (fcode == POINTER_TYPE
|| TYPE_PTRMEM_P (from) || TYPE_PTRDATAMEM_P (from)
|| (TYPE_PTRMEMFUNC_P (from) || (TYPE_PTRMEMFUNC_P (from)
&& conv->rank < cr_pbool) && conv->rank < cr_pbool)
|| NULLPTR_TYPE_P (from)) || NULLPTR_TYPE_P (from))
@ -2334,7 +2334,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code,
case MEMBER_REF: case MEMBER_REF:
if (TREE_CODE (type1) == POINTER_TYPE if (TREE_CODE (type1) == POINTER_TYPE
&& TYPE_PTR_TO_MEMBER_P (type2)) && TYPE_PTRMEM_P (type2))
{ {
tree c1 = TREE_TYPE (type1); tree c1 = TREE_TYPE (type1);
tree c2 = TYPE_PTRMEM_CLASS_TYPE (type2); tree c2 = TYPE_PTRMEM_CLASS_TYPE (type2);
@ -2406,14 +2406,14 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code,
case EQ_EXPR: case EQ_EXPR:
case NE_EXPR: case NE_EXPR:
if ((TYPE_PTRMEMFUNC_P (type1) && TYPE_PTRMEMFUNC_P (type2)) 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; 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; type2 = type1;
break; 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; type1 = type2;
break; break;
@ -2552,7 +2552,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code,
break; break;
if ((TYPE_PTRMEMFUNC_P (type1) && TYPE_PTRMEMFUNC_P (type2)) if ((TYPE_PTRMEMFUNC_P (type1) && TYPE_PTRMEMFUNC_P (type2))
|| (TYPE_PTR_P (type1) && TYPE_PTR_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) || ((TYPE_PTRMEMFUNC_P (type1)
|| TREE_CODE (type1) == POINTER_TYPE) || TREE_CODE (type1) == POINTER_TYPE)
&& null_ptr_cst_p (args[1]))) && null_ptr_cst_p (args[1])))
@ -2589,8 +2589,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code,
break; break;
/* Otherwise, the types should be pointers. */ /* Otherwise, the types should be pointers. */
if (!(TYPE_PTR_P (type1) || TYPE_PTR_TO_MEMBER_P (type1)) if (!TYPE_PTR_OR_PTRMEM_P (type1) || !TYPE_PTR_OR_PTRMEM_P (type2))
|| !(TYPE_PTR_P (type2) || TYPE_PTR_TO_MEMBER_P (type2)))
return; return;
/* We don't check that the two types are the same; the logic /* We don't check that the two types are the same; the logic
@ -2615,12 +2614,12 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code,
&& TREE_CODE (type1) == TREE_CODE (type2) && TREE_CODE (type1) == TREE_CODE (type2)
&& (TREE_CODE (type1) == REFERENCE_TYPE && (TREE_CODE (type1) == REFERENCE_TYPE
|| (TYPE_PTR_P (type1) && TYPE_PTR_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) || TYPE_PTRMEMFUNC_P (type1)
|| MAYBE_CLASS_TYPE_P (type1) || MAYBE_CLASS_TYPE_P (type1)
|| TREE_CODE (type1) == ENUMERAL_TYPE)) || 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, tree cptype = composite_pointer_type (type1, type2,
error_mark_node, error_mark_node,
@ -4733,11 +4732,11 @@ build_conditional_expr_1 (tree arg1, tree arg2, tree arg3,
cv-qualification of either the second or the third operand. cv-qualification of either the second or the third operand.
The result is of the common type. */ The result is of the common type. */
else if ((null_ptr_cst_p (arg2) 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) || (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_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))) || (TYPE_PTRMEMFUNC_P (arg2_type) && TYPE_PTRMEMFUNC_P (arg3_type)))
{ {
result_type = composite_pointer_type (arg2_type, arg3_type, arg2, result_type = composite_pointer_type (arg2_type, arg3_type, arg2,
@ -7857,8 +7856,8 @@ compare_ics (conversion *ics1, conversion *ics2)
for pointers A*, except opposite: if B is derived from A then for pointers A*, except opposite: if B is derived from A then
A::* converts to B::*, not vice versa. For that reason, we A::* converts to B::*, not vice versa. For that reason, we
switch the from_ and to_ variables here. */ switch the from_ and to_ variables here. */
else if ((TYPE_PTRMEM_P (from_type1) && TYPE_PTRMEM_P (from_type2) else if ((TYPE_PTRDATAMEM_P (from_type1) && TYPE_PTRDATAMEM_P (from_type2)
&& TYPE_PTRMEM_P (to_type1) && TYPE_PTRMEM_P (to_type2)) && TYPE_PTRDATAMEM_P (to_type1) && TYPE_PTRDATAMEM_P (to_type2))
|| (TYPE_PTRMEMFUNC_P (from_type1) || (TYPE_PTRMEMFUNC_P (from_type1)
&& TYPE_PTRMEMFUNC_P (from_type2) && TYPE_PTRMEMFUNC_P (from_type2)
&& TYPE_PTRMEMFUNC_P (to_type1) && TYPE_PTRMEMFUNC_P (to_type1)

View File

@ -3219,8 +3219,7 @@ check_field_decls (tree t, tree *access_decls,
to members which might hold dynamic memory. So do not warn to members which might hold dynamic memory. So do not warn
for pointers to functions or pointers to members. */ for pointers to functions or pointers to members. */
if (TYPE_PTR_P (type) if (TYPE_PTR_P (type)
&& !TYPE_PTRFN_P (type) && !TYPE_PTRFN_P (type))
&& !TYPE_PTR_TO_MEMBER_P (type))
has_pointers = true; has_pointers = true;
if (CLASS_TYPE_P (type)) if (CLASS_TYPE_P (type))

View File

@ -1,5 +1,5 @@
/* Some code common to C++ and ObjC++ front ends. /* 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. Free Software Foundation, Inc.
Contributed by Ziemowit Laski <zlaski@apple.com> Contributed by Ziemowit Laski <zlaski@apple.com>
@ -118,7 +118,7 @@ cp_var_mod_type_p (tree type, tree fn)
{ {
/* If TYPE is a pointer-to-member, it is variably modified if either /* If TYPE is a pointer-to-member, it is variably modified if either
the class or the member are variably modified. */ 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) return (variably_modified_type_p (TYPE_PTRMEM_CLASS_TYPE (type), fn)
|| variably_modified_type_p (TYPE_PTRMEM_POINTED_TO_TYPE (type), || variably_modified_type_p (TYPE_PTRMEM_POINTED_TO_TYPE (type),
fn)); fn));

View File

@ -3191,7 +3191,7 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
Keep these checks in ascending code order. */ Keep these checks in ascending code order. */
#define SCALAR_TYPE_P(TYPE) \ #define SCALAR_TYPE_P(TYPE) \
(TYPE_PTRMEM_P (TYPE) \ (TYPE_PTRDATAMEM_P (TYPE) \
|| TREE_CODE (TYPE) == ENUMERAL_TYPE \ || TREE_CODE (TYPE) == ENUMERAL_TYPE \
|| ARITHMETIC_TYPE_P (TYPE) \ || ARITHMETIC_TYPE_P (TYPE) \
|| TYPE_PTR_P (TYPE) \ || TYPE_PTR_P (TYPE) \
@ -3376,7 +3376,7 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
(TYPE_HAS_COPY_ASSIGN (NODE) && ! TYPE_HAS_COMPLEX_COPY_ASSIGN (NODE)) (TYPE_HAS_COPY_ASSIGN (NODE) && ! TYPE_HAS_COMPLEX_COPY_ASSIGN (NODE))
/* Returns true if NODE is a pointer-to-data-member. */ /* 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) (TREE_CODE (NODE) == OFFSET_TYPE)
/* Returns true if NODE is a pointer. */ /* Returns true if NODE is a pointer. */
#define TYPE_PTR_P(NODE) \ #define TYPE_PTR_P(NODE) \
@ -3434,8 +3434,12 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
(LANG_TYPE_CLASS_CHECK (NODE)->ptrmemfunc_flag) (LANG_TYPE_CLASS_CHECK (NODE)->ptrmemfunc_flag)
/* Returns true if NODE is a pointer-to-member. */ /* Returns true if NODE is a pointer-to-member. */
#define TYPE_PTR_TO_MEMBER_P(NODE) \ #define TYPE_PTRMEM_P(NODE) \
(TYPE_PTRMEM_P (NODE) || TYPE_PTRMEMFUNC_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 /* Indicates when overload resolution may resolve to a pointer to
member function. [expr.unary.op]/3 */ member function. [expr.unary.op]/3 */
@ -3473,13 +3477,13 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
TYPE_PTRMEM_POINTED_TO_TYPE; there, the first parameter will have TYPE_PTRMEM_POINTED_TO_TYPE; there, the first parameter will have
type `const X*'. */ type `const X*'. */
#define TYPE_PTRMEM_CLASS_TYPE(NODE) \ #define TYPE_PTRMEM_CLASS_TYPE(NODE) \
(TYPE_PTRMEM_P (NODE) \ (TYPE_PTRDATAMEM_P (NODE) \
? TYPE_OFFSET_BASETYPE (NODE) \ ? TYPE_OFFSET_BASETYPE (NODE) \
: TYPE_PTRMEMFUNC_OBJECT_TYPE (NODE)) : TYPE_PTRMEMFUNC_OBJECT_TYPE (NODE))
/* For a pointer-to-member type of the form `T X::*', this is `T'. */ /* For a pointer-to-member type of the form `T X::*', this is `T'. */
#define TYPE_PTRMEM_POINTED_TO_TYPE(NODE) \ #define TYPE_PTRMEM_POINTED_TO_TYPE(NODE) \
(TYPE_PTRMEM_P (NODE) \ (TYPE_PTRDATAMEM_P (NODE) \
? TREE_TYPE (NODE) \ ? TREE_TYPE (NODE) \
: TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (NODE))) : TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (NODE)))

View File

@ -175,7 +175,7 @@ cp_convert_to_pointer (tree type, tree expr)
return build_nop (type, expr); 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))) || (TYPE_PTRMEMFUNC_P (type) && TYPE_PTRMEMFUNC_P (intype)))
return convert_ptrmem (type, expr, /*allow_inverse_p=*/false, return convert_ptrmem (type, expr, /*allow_inverse_p=*/false,
/*c_cast_p=*/false, tf_warning_or_error); /*c_cast_p=*/false, tf_warning_or_error);
@ -210,7 +210,7 @@ cp_convert_to_pointer (tree type, tree expr)
return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0, return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0,
/*c_cast_p=*/false, tf_warning_or_error); /*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 /* A NULL pointer-to-member is represented by -1, not by
zero. */ zero. */
@ -221,7 +221,7 @@ cp_convert_to_pointer (tree type, tree expr)
return expr; 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); error_at (loc, "invalid conversion from %qT to %qT", intype, type);
return error_mark_node; return error_mark_node;
@ -767,7 +767,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
} }
if (NULLPTR_TYPE_P (type) && e && null_ptr_cst_p (e)) if (NULLPTR_TYPE_P (type) && e && null_ptr_cst_p (e))
return nullptr_node; 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)); return fold_if_not_in_template (cp_convert_to_pointer (type, e));
if (code == VECTOR_TYPE) if (code == VECTOR_TYPE)
{ {
@ -1722,8 +1722,7 @@ perform_qualification_conversions (tree type, tree expr)
else if (TYPE_PTR_P (type) && TYPE_PTR_P (expr_type) else if (TYPE_PTR_P (type) && TYPE_PTR_P (expr_type)
&& comp_ptr_ttypes (TREE_TYPE (type), TREE_TYPE (expr_type))) && comp_ptr_ttypes (TREE_TYPE (type), TREE_TYPE (expr_type)))
return build_nop (type, expr); return build_nop (type, expr);
else if (TYPE_PTR_TO_MEMBER_P (type) else if (TYPE_PTRMEM_P (type) && TYPE_PTRMEM_P (expr_type)
&& TYPE_PTR_TO_MEMBER_P (expr_type)
&& same_type_p (TYPE_PTRMEM_CLASS_TYPE (type), && same_type_p (TYPE_PTRMEM_CLASS_TYPE (type),
TYPE_PTRMEM_CLASS_TYPE (expr_type)) TYPE_PTRMEM_CLASS_TYPE (expr_type))
&& comp_ptr_ttypes (TYPE_PTRMEM_POINTED_TO_TYPE (type), && comp_ptr_ttypes (TYPE_PTRMEM_POINTED_TO_TYPE (type),

View File

@ -1345,8 +1345,7 @@ pp_cxx_ptr_operator (cxx_pretty_printer *pp, tree t)
{ {
case REFERENCE_TYPE: case REFERENCE_TYPE:
case POINTER_TYPE: case POINTER_TYPE:
if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE if (TYPE_PTR_OR_PTRMEM_P (TREE_TYPE (t)))
|| TYPE_PTR_TO_MEMBER_P (TREE_TYPE (t)))
pp_cxx_ptr_operator (pp, TREE_TYPE (t)); pp_cxx_ptr_operator (pp, TREE_TYPE (t));
pp_c_attributes_display (pp_c_base (pp), pp_c_attributes_display (pp_c_base (pp),
TYPE_ATTRIBUTES (TREE_TYPE (t))); TYPE_ATTRIBUTES (TREE_TYPE (t)));
@ -1368,7 +1367,7 @@ pp_cxx_ptr_operator (cxx_pretty_printer *pp, tree t)
break; break;
} }
case OFFSET_TYPE: case OFFSET_TYPE:
if (TYPE_PTR_TO_MEMBER_P (t)) if (TYPE_PTRMEM_P (t))
{ {
if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE) if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE)
pp_cxx_left_paren (pp); pp_cxx_left_paren (pp);
@ -1641,7 +1640,7 @@ pp_cxx_function_definition (cxx_pretty_printer *pp, tree t)
static void static void
pp_cxx_abstract_declarator (cxx_pretty_printer *pp, tree t) 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); pp_cxx_right_paren (pp);
else if (POINTER_TYPE_P (t)) else if (POINTER_TYPE_P (t))
{ {

View File

@ -10619,7 +10619,7 @@ check_default_argument (tree decl, tree arg)
if (warn_zero_as_null_pointer_constant if (warn_zero_as_null_pointer_constant
&& c_inhibit_evaluation_warnings == 0 && 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) && null_ptr_cst_p (arg)
&& !NULLPTR_TYPE_P (TREE_TYPE (arg))) && !NULLPTR_TYPE_P (TREE_TYPE (arg)))
{ {

View File

@ -178,7 +178,7 @@ build_zero_init_1 (tree type, tree nelts, bool static_storage_p,
items with static storage duration that are not otherwise items with static storage duration that are not otherwise
initialized are initialized to zero. */ 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); init = convert (type, nullptr_node);
else if (SCALAR_TYPE_P (type)) else if (SCALAR_TYPE_P (type))
init = convert (type, integer_zero_node); init = convert (type, integer_zero_node);

View File

@ -1845,7 +1845,7 @@ write_type (tree type)
if (TREE_CODE (type) == RECORD_TYPE && TYPE_TRANSPARENT_AGGR (type)) if (TREE_CODE (type) == RECORD_TYPE && TYPE_TRANSPARENT_AGGR (type))
type = TREE_TYPE (first_field (type)); type = TREE_TYPE (first_field (type));
if (TYPE_PTRMEM_P (type)) if (TYPE_PTRDATAMEM_P (type))
write_pointer_to_member_type (type); write_pointer_to_member_type (type);
else else
{ {

View File

@ -5309,7 +5309,7 @@ arg_assoc_type (struct arg_lookup *k, tree type)
if (!type) if (!type)
return false; return false;
if (TYPE_PTRMEM_P (type)) if (TYPE_PTRDATAMEM_P (type))
{ {
/* Pointer to member: associate class type and value type. */ /* Pointer to member: associate class type and value type. */
if (arg_assoc_type (k, TYPE_PTRMEM_CLASS_TYPE (type))) if (arg_assoc_type (k, TYPE_PTRMEM_CLASS_TYPE (type)))

View File

@ -5720,8 +5720,7 @@ convert_nontype_argument (tree type, tree expr, tsubst_flags_t complain)
/* 14.3.2/5: The null pointer{,-to-member} conversion is applied /* 14.3.2/5: The null pointer{,-to-member} conversion is applied
to a non-type argument of "nullptr". */ to a non-type argument of "nullptr". */
if (expr == nullptr_node if (expr == nullptr_node && TYPE_PTR_OR_PTRMEM_P (type))
&& (TYPE_PTR_P (type) || TYPE_PTR_TO_MEMBER_P (type)))
expr = convert (type, expr); expr = convert (type, expr);
/* In C++11, integral or enumeration non-type template arguments can be /* In C++11, integral or enumeration non-type template arguments can be
@ -5737,8 +5736,7 @@ convert_nontype_argument (tree type, tree expr, tsubst_flags_t complain)
CONSTRUCTOR. */; CONSTRUCTOR. */;
else if (INTEGRAL_OR_ENUMERATION_TYPE_P (type)) else if (INTEGRAL_OR_ENUMERATION_TYPE_P (type))
expr = maybe_constant_value (expr); expr = maybe_constant_value (expr);
else if (TYPE_PTR_P (type) else if (TYPE_PTR_OR_PTRMEM_P (type))
|| TYPE_PTR_TO_MEMBER_P (type))
{ {
tree folded = maybe_constant_value (expr); tree folded = maybe_constant_value (expr);
if (TYPE_PTR_P (type) ? integer_zerop (folded) if (TYPE_PTR_P (type) ? integer_zerop (folded)
@ -6073,7 +6071,7 @@ convert_nontype_argument (tree type, tree expr, tsubst_flags_t complain)
For a non-type template-parameter of type pointer to data member, For a non-type template-parameter of type pointer to data member,
qualification conversions (_conv.qual_) are applied. */ 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 /* [temp.arg.nontype] bullet 1 says the pointer to member
expression must be a pointer-to-member constant. */ expression must be a pointer-to-member constant. */
@ -19169,7 +19167,7 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain)
return 0; return 0;
else if (POINTER_TYPE_P (type)) else if (POINTER_TYPE_P (type))
return 0; return 0;
else if (TYPE_PTR_TO_MEMBER_P (type)) else if (TYPE_PTRMEM_P (type))
return 0; return 0;
else if (TREE_CODE (type) == TEMPLATE_TYPE_PARM) else if (TREE_CODE (type) == TEMPLATE_TYPE_PARM)
return 0; return 0;
@ -19218,7 +19216,7 @@ dependent_type_p_r (tree type)
dependent. */ dependent. */
type = TYPE_MAIN_VARIANT (type); type = TYPE_MAIN_VARIANT (type);
/* -- a compound type constructed from any dependent 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)) return (dependent_type_p (TYPE_PTRMEM_CLASS_TYPE (type))
|| dependent_type_p (TYPE_PTRMEM_POINTED_TO_TYPE || dependent_type_p (TYPE_PTRMEM_POINTED_TO_TYPE
(type))); (type)));

View File

@ -816,7 +816,7 @@ static bool
target_incomplete_p (tree type) target_incomplete_p (tree type)
{ {
while (true) while (true)
if (TYPE_PTRMEM_P (type)) if (TYPE_PTRDATAMEM_P (type))
{ {
if (!COMPLETE_TYPE_P (TYPE_PTRMEM_CLASS_TYPE (type))) if (!COMPLETE_TYPE_P (TYPE_PTRMEM_CLASS_TYPE (type)))
return true; return true;

View File

@ -2773,7 +2773,7 @@ zero_init_p (const_tree t)
return 1; return 1;
/* NULL pointers to data members are initialized with -1. */ /* NULL pointers to data members are initialized with -1. */
if (TYPE_PTRMEM_P (t)) if (TYPE_PTRDATAMEM_P (t))
return 0; return 0;
/* Classes that contain types that can't be zero-initialized, cannot /* Classes that contain types that can't be zero-initialized, cannot

View File

@ -509,8 +509,7 @@ composite_pointer_type_r (tree t1, tree t2,
result_type = pointee1; result_type = pointee1;
else if ((TREE_CODE (pointee1) == POINTER_TYPE else if ((TREE_CODE (pointee1) == POINTER_TYPE
&& TREE_CODE (pointee2) == POINTER_TYPE) && TREE_CODE (pointee2) == POINTER_TYPE)
|| (TYPE_PTR_TO_MEMBER_P (pointee1) || (TYPE_PTRMEM_P (pointee1) && TYPE_PTRMEM_P (pointee2)))
&& TYPE_PTR_TO_MEMBER_P (pointee2)))
{ {
result_type = composite_pointer_type_r (pointee1, pointee2, operation, result_type = composite_pointer_type_r (pointee1, pointee2, operation,
complain); complain);
@ -530,7 +529,7 @@ composite_pointer_type_r (tree t1, tree t2,
| cp_type_quals (pointee2))); | cp_type_quals (pointee2)));
/* If the original types were pointers to members, so is the /* If the original types were pointers to members, so is the
result. */ result. */
if (TYPE_PTR_TO_MEMBER_P (t1)) if (TYPE_PTRMEM_P (t1))
{ {
if (!same_type_p (TYPE_PTRMEM_CLASS_TYPE (t1), if (!same_type_p (TYPE_PTRMEM_CLASS_TYPE (t1),
TYPE_PTRMEM_CLASS_TYPE (t2))) TYPE_PTRMEM_CLASS_TYPE (t2)))
@ -666,7 +665,7 @@ composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2,
} }
/* [expr.eq] permits the application of a pointer-to-member /* [expr.eq] permits the application of a pointer-to-member
conversion to change the class type of one of the types. */ 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), && !same_type_p (TYPE_PTRMEM_CLASS_TYPE (t1),
TYPE_PTRMEM_CLASS_TYPE (t2))) TYPE_PTRMEM_CLASS_TYPE (t2)))
{ {
@ -931,7 +930,7 @@ tree
common_pointer_type (tree t1, tree t2) common_pointer_type (tree t1, tree t2)
{ {
gcc_assert ((TYPE_PTR_P (t1) && TYPE_PTR_P (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))); || (TYPE_PTRMEMFUNC_P (t1) && TYPE_PTRMEMFUNC_P (t2)));
return composite_pointer_type (t1, t2, error_mark_node, error_mark_node, return composite_pointer_type (t1, t2, error_mark_node, error_mark_node,
@ -2835,7 +2834,7 @@ cp_build_indirect_ref (tree ptr, ref_operator errorstring,
; ;
/* `pointer' won't be an error_mark_node if we were given a /* `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. */ 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) switch (errorstring)
{ {
case RO_ARRAY_INDEXING: case RO_ARRAY_INDEXING:
@ -3839,9 +3838,9 @@ cp_build_binary_op (location_t location,
&& code != EQ_EXPR && code != NE_EXPR && code != MINUS_EXPR) && code != EQ_EXPR && code != NE_EXPR && code != MINUS_EXPR)
/* Or if one of OP0 or OP1 is neither a pointer nor NULL. */ /* Or if one of OP0 or OP1 is neither a pointer nor NULL. */
|| (!null_ptr_cst_p (orig_op0) || (!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) || (!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)) && (complain & tf_warning))
{ {
source_location loc = source_location loc =
@ -4075,10 +4074,10 @@ cp_build_binary_op (location_t location,
|| code1 == COMPLEX_TYPE || code1 == ENUMERAL_TYPE)) || code1 == COMPLEX_TYPE || code1 == ENUMERAL_TYPE))
short_compare = 1; short_compare = 1;
else if ((code0 == POINTER_TYPE && code1 == POINTER_TYPE) 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, result_type = composite_pointer_type (type0, type1, op0, op1,
CPO_COMPARISON, complain); 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)) && null_ptr_cst_p (op1))
{ {
if (TREE_CODE (op0) == ADDR_EXPR if (TREE_CODE (op0) == ADDR_EXPR
@ -4091,7 +4090,7 @@ cp_build_binary_op (location_t location,
} }
result_type = type0; 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)) && null_ptr_cst_p (op0))
{ {
if (TREE_CODE (op1) == ADDR_EXPR if (TREE_CODE (op1) == ADDR_EXPR
@ -4769,7 +4768,7 @@ tree
cp_truthvalue_conversion (tree expr) cp_truthvalue_conversion (tree expr)
{ {
tree type = TREE_TYPE (expr); tree type = TREE_TYPE (expr);
if (TYPE_PTRMEM_P (type)) if (TYPE_PTRDATAMEM_P (type))
return build_binary_op (EXPR_LOCATION (expr), return build_binary_op (EXPR_LOCATION (expr),
NE_EXPR, expr, nullptr_node, 1); NE_EXPR, expr, nullptr_node, 1);
else if (TYPE_PTR_P (type) || TYPE_PTRMEMFUNC_P (type)) else if (TYPE_PTR_P (type) || TYPE_PTRMEMFUNC_P (type))
@ -5855,7 +5854,7 @@ tree
convert_ptrmem (tree type, tree expr, bool allow_inverse_p, convert_ptrmem (tree type, tree expr, bool allow_inverse_p,
bool c_cast_p, tsubst_flags_t complain) bool c_cast_p, tsubst_flags_t complain)
{ {
if (TYPE_PTRMEM_P (type)) if (TYPE_PTRDATAMEM_P (type))
{ {
tree delta; tree delta;
@ -6088,7 +6087,7 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p,
return cp_fold_convert(type, expr); 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))) || (TYPE_PTRMEMFUNC_P (type) && TYPE_PTRMEMFUNC_P (intype)))
{ {
tree c1; tree c1;
@ -6099,7 +6098,7 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p,
c1 = TYPE_PTRMEM_CLASS_TYPE (intype); c1 = TYPE_PTRMEM_CLASS_TYPE (intype);
c2 = TYPE_PTRMEM_CLASS_TYPE (type); c2 = TYPE_PTRMEM_CLASS_TYPE (type);
if (TYPE_PTRMEM_P (type)) if (TYPE_PTRDATAMEM_P (type))
{ {
t1 = (build_ptrmem_type t1 = (build_ptrmem_type
(c1, (c1,
@ -6345,14 +6344,14 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p,
/* OK */ /* OK */
; ;
else if ((INTEGRAL_OR_ENUMERATION_TYPE_P (type) 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)) && same_type_p (type, intype))
/* DR 799 */ /* DR 799 */
return fold_if_not_in_template (build_nop (type, expr)); return fold_if_not_in_template (build_nop (type, expr));
else if ((TYPE_PTRFN_P (type) && TYPE_PTRFN_P (intype)) else if ((TYPE_PTRFN_P (type) && TYPE_PTRFN_P (intype))
|| (TYPE_PTRMEMFUNC_P (type) && TYPE_PTRMEMFUNC_P (intype))) || (TYPE_PTRMEMFUNC_P (type) && TYPE_PTRMEMFUNC_P (intype)))
return fold_if_not_in_template (build_nop (type, expr)); 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))) || (TYPE_PTROBV_P (type) && TYPE_PTROBV_P (intype)))
{ {
tree sexpr = expr; tree sexpr = expr;
@ -6460,7 +6459,7 @@ build_const_cast_1 (tree dst_type, tree expr, tsubst_flags_t complain,
if (valid_p) if (valid_p)
*valid_p = false; *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) if (complain & tf_error)
error ("invalid use of const_cast with type %qT, " error ("invalid use of const_cast with type %qT, "
@ -6530,7 +6529,7 @@ build_const_cast_1 (tree dst_type, tree expr, tsubst_flags_t complain,
return error_mark_node; 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 (comp_ptr_ttypes_const (dst_type, src_type))
{ {
@ -8191,7 +8190,7 @@ comp_ptr_ttypes_real (tree to, tree from, int constp)
if (TREE_CODE (to) == VECTOR_TYPE) if (TREE_CODE (to) == VECTOR_TYPE)
is_opaque_pointer = vector_targets_convertible_p (to, from); 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) return ((constp >= 0 || to_more_cv_qualified)
&& (is_opaque_pointer && (is_opaque_pointer
|| same_type_ignoring_top_level_qualifiers_p (to, from))); || same_type_ignoring_top_level_qualifiers_p (to, from)));
@ -8460,8 +8459,8 @@ casts_away_constness_r (tree *t1, tree *t2, tsubst_flags_t complain)
to to
Tcv2,(M-K+1) * cv2,(M-K+2) * ... cv2,M *. */ Tcv2,(M-K+1) * cv2,(M-K+2) * ... cv2,M *. */
if ((!TYPE_PTR_P (*t1) && !TYPE_PTRMEM_P (*t1)) if ((!TYPE_PTR_P (*t1) && !TYPE_PTRDATAMEM_P (*t1))
|| (!TYPE_PTR_P (*t2) && !TYPE_PTRMEM_P (*t2))) || (!TYPE_PTR_P (*t2) && !TYPE_PTRDATAMEM_P (*t2)))
{ {
*t1 = cp_build_qualified_type (void_type_node, *t1 = cp_build_qualified_type (void_type_node,
cp_type_quals (*t1)); cp_type_quals (*t1));
@ -8473,11 +8472,11 @@ casts_away_constness_r (tree *t1, tree *t2, tsubst_flags_t complain)
quals1 = cp_type_quals (*t1); quals1 = cp_type_quals (*t1);
quals2 = cp_type_quals (*t2); quals2 = cp_type_quals (*t2);
if (TYPE_PTRMEM_P (*t1)) if (TYPE_PTRDATAMEM_P (*t1))
*t1 = TYPE_PTRMEM_POINTED_TO_TYPE (*t1); *t1 = TYPE_PTRMEM_POINTED_TO_TYPE (*t1);
else else
*t1 = TREE_TYPE (*t1); *t1 = TREE_TYPE (*t1);
if (TYPE_PTRMEM_P (*t2)) if (TYPE_PTRDATAMEM_P (*t2))
*t2 = TYPE_PTRMEM_POINTED_TO_TYPE (*t2); *t2 = TYPE_PTRMEM_POINTED_TO_TYPE (*t2);
else else
*t2 = TREE_TYPE (*t2); *t2 = TREE_TYPE (*t2);
@ -8514,7 +8513,7 @@ casts_away_constness (tree t1, tree t2, tsubst_flags_t complain)
complain); complain);
} }
if (TYPE_PTRMEM_P (t1) && TYPE_PTRMEM_P (t2)) if (TYPE_PTRDATAMEM_P (t1) && TYPE_PTRDATAMEM_P (t2))
/* [expr.const.cast] /* [expr.const.cast]
Casting from an rvalue of type "pointer to data member of X Casting from an rvalue of type "pointer to data member of X

View File

@ -1573,7 +1573,7 @@ build_m_component_ref (tree datum, tree component, tsubst_flags_t complain)
component = mark_rvalue_use (component); component = mark_rvalue_use (component);
ptrmem_type = TREE_TYPE (component); ptrmem_type = TREE_TYPE (component);
if (!TYPE_PTR_TO_MEMBER_P (ptrmem_type)) if (!TYPE_PTRMEM_P (ptrmem_type))
{ {
if (complain & tf_error) if (complain & tf_error)
error ("%qE cannot be used as a member pointer, since it is of " error ("%qE cannot be used as a member pointer, since it is of "
@ -1615,7 +1615,7 @@ build_m_component_ref (tree datum, tree component, tsubst_flags_t complain)
return error_mark_node; return error_mark_node;
} }
if (TYPE_PTRMEM_P (ptrmem_type)) if (TYPE_PTRDATAMEM_P (ptrmem_type))
{ {
bool is_lval = real_lvalue_p (datum); bool is_lval = real_lvalue_p (datum);
tree ptype; tree ptype;