diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1999-01-04 11:55:37 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1999-01-04 06:55:37 -0500 |
commit | 8d7f862cfb3846ee764e9ec4fbe4fbb3d3ceaace (patch) | |
tree | b3574def0395c123dd0c20be1323fd1137b65ee1 /gcc | |
parent | 007e5feae7519fb672d81a2681ff433186758732 (diff) | |
download | gcc-8d7f862cfb3846ee764e9ec4fbe4fbb3d3ceaace.zip gcc-8d7f862cfb3846ee764e9ec4fbe4fbb3d3ceaace.tar.gz gcc-8d7f862cfb3846ee764e9ec4fbe4fbb3d3ceaace.tar.bz2 |
tree.c (bound_pmf_p): New fn.
* tree.c (bound_pmf_p): New fn.
* typeck.c (build_c_cast): Use it.
From-SVN: r24481
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/tree.c | 11 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 5 |
3 files changed, 16 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3721043..d120ab5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 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. Tue Dec 22 15:09:25 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 8777a11..b5b73cb 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1338,6 +1338,17 @@ get_first_fn (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. */ tree diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index f9c2057..b0b3be9 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -5630,10 +5630,9 @@ build_c_cast (type, expr) { if (TREE_CODE (TREE_TYPE (value)) == FUNCTION_TYPE || (TREE_CODE (TREE_TYPE (value)) == METHOD_TYPE - /* Don't do the default conversion if we want a - pointer to a function. */ + /* Don't do the default conversion on a ->* expression. */ && ! (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)) == REFERENCE_TYPE) value = default_conversion (value); |