Commit 3e0b4710 by Jason Merrill Committed by Jason Merrill

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
parent b7e48b2d
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> 1999-05-24 Mark Mitchell <mark@codesourcery.com>
* decl2.c (mark_vtable_entries): Don't make a copy of a function, * decl2.c (mark_vtable_entries): Don't make a copy of a function,
......
...@@ -7771,9 +7771,9 @@ casts_away_constness_r (t1, t2) ...@@ -7771,9 +7771,9 @@ casts_away_constness_r (t1, t2)
pointer to member level is ignored when determining if a const pointer to member level is ignored when determining if a const
cv-qualifier has been cast away. */ cv-qualifier has been cast away. */
if (TYPE_PTRMEM_P (*t1)) 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)) if (TYPE_PTRMEM_P (*t2))
*t2 = build_pointer_type (TREE_TYPE (*t2)); *t2 = build_pointer_type (TREE_TYPE (TREE_TYPE (*t2)));
/* [expr.const.cast] /* [expr.const.cast]
...@@ -7844,8 +7844,9 @@ casts_away_constness (t1, t2) ...@@ -7844,8 +7844,9 @@ casts_away_constness (t1, t2)
T2" casts away constness if a cast from an rvalue of type T2" casts away constness if a cast from an rvalue of type
"poitner to T1" to the type "pointer to T2" casts away "poitner to T1" to the type "pointer to T2" casts away
constness. */ constness. */
return casts_away_constness (build_pointer_type (TREE_TYPE (t1)), return casts_away_constness
build_pointer_type (TREE_TYPE (t2))); (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 /* Casting away constness is only something that makes sense for
pointer or reference types. */ pointer or reference types. */
......
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