typeck.c (merge_types): Handle cv-qualified pointer-to-member types correctly.

* typeck.c (merge_types): Handle cv-qualified pointer-to-member
	types correctly.

	* g++.dg/conversion/ptrmem1.C: New test.

From-SVN: r70341
This commit is contained in:
Mark Mitchell 2003-08-11 23:11:32 +00:00 committed by Mark Mitchell
parent 5f5e441a4a
commit fe0378ed74
4 changed files with 30 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2003-08-11 Mark Mitchell <mark@codesourcery.com>
* typeck.c (merge_types): Handle cv-qualified pointer-to-member
types correctly.
2003-08-10 Mark Mitchell <mark@codesourcery.com>
PR c++/11789

View File

@ -630,9 +630,14 @@ merge_types (tree t1, tree t2)
case OFFSET_TYPE:
{
tree base = TYPE_OFFSET_BASETYPE (t1);
tree target = merge_types (TREE_TYPE (t1), TREE_TYPE (t2));
t1 = build_offset_type (base, target);
int quals;
tree pointee;
quals = cp_type_quals (t1);
pointee = merge_types (TYPE_PTRMEM_POINTED_TO_TYPE (t1),
TYPE_PTRMEM_POINTED_TO_TYPE (t2));
t1 = build_ptrmem_type (TYPE_PTRMEM_CLASS_TYPE (t1),
pointee);
t1 = cp_build_qualified_type (t1, quals);
break;
}

View File

@ -1,3 +1,7 @@
2003-08-11 Mark Mitchell <mark@codesourcery.com>
* g++.dg/conversion/ptrmem1.C: New test.
2003-08-11 Jakub Jelinek <jakub@redhat.com>
PR target/11693

View File

@ -0,0 +1,13 @@
struct S {};
void f (int S::*const*);
typedef int I;
void f (I S::*const*);
void g() {
int S::*const* p;
f(p);
}