Commit 8d7f862c by Jason Merrill Committed by Jason Merrill

tree.c (bound_pmf_p): New fn.

	* tree.c (bound_pmf_p): New fn.
	* typeck.c (build_c_cast): Use it.

From-SVN: r24481
parent 007e5fea
1999-01-04 Jason Merrill <jason@yorick.cygnus.com> 1999-01-04 Jason Merrill <jason@yorick.cygnus.com>
* tree.c (bound_pmf_p): New fn.
* typeck.c (build_c_cast): Use it.
* decl.c (grok_op_properties): Use same_type_p. * decl.c (grok_op_properties): Use same_type_p.
Tue Dec 22 15:09:25 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Tue Dec 22 15:09:25 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
......
...@@ -1338,6 +1338,17 @@ get_first_fn (from) ...@@ -1338,6 +1338,17 @@ get_first_fn (from)
return OVL_CURRENT (from); return OVL_CURRENT (from);
} }
/* Returns nonzero if T is a ->* or .* expression that refers to a
member function. */
int
bound_pmf_p (t)
tree t;
{
return (TREE_CODE (t) == OFFSET_REF
&& TYPE_PTRMEMFUNC_P (TREE_TYPE (TREE_OPERAND (t, 1))));
}
/* Return a new OVL node, concatenating it with the old one. */ /* Return a new OVL node, concatenating it with the old one. */
tree tree
......
...@@ -5630,10 +5630,9 @@ build_c_cast (type, expr) ...@@ -5630,10 +5630,9 @@ build_c_cast (type, expr)
{ {
if (TREE_CODE (TREE_TYPE (value)) == FUNCTION_TYPE if (TREE_CODE (TREE_TYPE (value)) == FUNCTION_TYPE
|| (TREE_CODE (TREE_TYPE (value)) == METHOD_TYPE || (TREE_CODE (TREE_TYPE (value)) == METHOD_TYPE
/* Don't do the default conversion if we want a /* Don't do the default conversion on a ->* expression. */
pointer to a function. */
&& ! (TREE_CODE (type) == POINTER_TYPE && ! (TREE_CODE (type) == POINTER_TYPE
&& TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)) && bound_pmf_p (value)))
|| TREE_CODE (TREE_TYPE (value)) == ARRAY_TYPE || TREE_CODE (TREE_TYPE (value)) == ARRAY_TYPE
|| TREE_CODE (TREE_TYPE (value)) == REFERENCE_TYPE) || TREE_CODE (TREE_TYPE (value)) == REFERENCE_TYPE)
value = default_conversion (value); value = default_conversion (value);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment