pointer-to-member types.
* pt.c (tsubst): Correctly qualify pointers-to-data member types.
* typeck.c (comp_ptr_ttypes_real): Check qualifiers on
pointer-to-data member types.
* g++.dg/template/ptrmem6.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69855
138bc75d-0d04-0410-961f-
82ee72b054a4
+2003-07-27 Mark Mitchell <mark@codesourcery.com>
+
+ * call.c (standard_conversion): Tweak handling of
+ pointer-to-member types.
+ * pt.c (tsubst): Correctly qualify pointers-to-data member types.
+ * typeck.c (comp_ptr_ttypes_real): Check qualifiers on
+ pointer-to-data member types.
+
2003-07-27 Nathan Sidwell <nathan@codesourcery.com>
* parser.c (cp_parser_type_parameter): Reformat.
}
else
{
- to_pointee = to;
- from_pointee = from;
+ to_pointee = TYPE_PTRMEM_POINTED_TO_TYPE (to);
+ from_pointee = TYPE_PTRMEM_POINTED_TO_TYPE (from);
}
if (same_type_p (from, to))
return build_ptrmemfunc_type (build_pointer_type (method_type));
}
else
- return build_ptrmem_type (r, type);
+ return cp_build_qualified_type_real (build_ptrmem_type (r, type),
+ TYPE_QUALS (t),
+ complain);
}
case FUNCTION_TYPE:
case METHOD_TYPE:
return 0;
if (TREE_CODE (from) == OFFSET_TYPE
- && same_type_p (TYPE_OFFSET_BASETYPE (from),
- TYPE_OFFSET_BASETYPE (to)))
- continue;
+ && !same_type_p (TYPE_OFFSET_BASETYPE (from),
+ TYPE_OFFSET_BASETYPE (to)))
+ return 0;
/* Const and volatile mean something different for function types,
so the usual checks are not appropriate. */
constp &= TYPE_READONLY (to);
}
- if (TREE_CODE (to) != POINTER_TYPE)
+ if (TREE_CODE (to) != POINTER_TYPE && !TYPE_PTR_TO_MEMBER_P (to))
return ((constp >= 0 || to_more_cv_qualified)
&& same_type_ignoring_top_level_qualifiers_p (to, from));
}
+2003-07-27 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/template/ptrmem6.C: New test.
+
2003-07-26 Geoffrey Keating <geoffk@apple.com>
* gcc.c-torture/compile/zero-strct-2.c: New test.
--- /dev/null
+struct S {};
+
+void g(int S::**);
+
+template <typename T>
+void f (int T::* volatile *p) {
+ g(p); // { dg-error "" }
+}
+
+template void f(int S::* volatile *); // { dg-error "instantiated" }