diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1999-05-25 11:55:58 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1999-05-25 07:55:58 -0400 |
commit | 3e0b47108c47627785b5553303aed0260e7bba40 (patch) | |
tree | 113fb873d60d1c61979f8233da43d659f2d92601 | |
parent | b7e48b2d294e34fdedbbf4584d661b3728d72402 (diff) | |
download | gcc-3e0b47108c47627785b5553303aed0260e7bba40.zip gcc-3e0b47108c47627785b5553303aed0260e7bba40.tar.gz gcc-3e0b47108c47627785b5553303aed0260e7bba40.tar.bz2 |
typeck.c (casts_away_constness, [...]): Strip both parts of pointer to data member types.
* typeck.c (casts_away_constness, casts_away_constness_r): Strip both
parts of pointer to data member types.
From-SVN: r27138
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 835402f..36cb365 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +1999-05-25 Jason Merrill <jason@yorick.cygnus.com> + + * typeck.c (casts_away_constness, casts_away_constness_r): Strip both + parts of pointer to data member types. + 1999-05-24 Mark Mitchell <mark@codesourcery.com> * decl2.c (mark_vtable_entries): Don't make a copy of a function, diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 13a490b..ead755d 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -7771,9 +7771,9 @@ casts_away_constness_r (t1, t2) pointer to member level is ignored when determining if a const cv-qualifier has been cast away. */ if (TYPE_PTRMEM_P (*t1)) - *t1 = build_pointer_type (TREE_TYPE (*t1)); + *t1 = build_pointer_type (TREE_TYPE (TREE_TYPE (*t1))); if (TYPE_PTRMEM_P (*t2)) - *t2 = build_pointer_type (TREE_TYPE (*t2)); + *t2 = build_pointer_type (TREE_TYPE (TREE_TYPE (*t2))); /* [expr.const.cast] @@ -7844,8 +7844,9 @@ casts_away_constness (t1, t2) T2" casts away constness if a cast from an rvalue of type "poitner to T1" to the type "pointer to T2" casts away constness. */ - return casts_away_constness (build_pointer_type (TREE_TYPE (t1)), - build_pointer_type (TREE_TYPE (t2))); + return casts_away_constness + (build_pointer_type (TREE_TYPE (TREE_TYPE (t1))), + build_pointer_type (TREE_TYPE (TREE_TYPE (t2)))); /* Casting away constness is only something that makes sense for pointer or reference types. */ |