2000-05-30 Mark Mitchell <mark@codesourcery.com>
+ * call.c (add_template_candidate_real): Handle member template
+ constructors for classes with virtual bases.
+ (build_user_type_conversion_1): Use in_charge_arg_for_name.
+ (build_new_method_call): Use DECL_NONSTATIC_MEMBER_FUNCTION_P.
+
+ * ir.texi: Update thunk documentation.
+
* call.c (joust): Fix handling of overloaded builtin operators.
2000-05-30 Zack Weinberg <zack@wolery.cumb.org>
{
int ntparms = DECL_NTPARMS (tmpl);
tree targs = make_tree_vec (ntparms);
+ tree args_without_in_chrg;
struct z_candidate *cand;
int i;
tree fn;
- i = fn_type_unification (tmpl, explicit_targs, targs, arglist,
+ /* TEMPLATE_DECLs do not have the in-charge parameter, nor the VTT
+ parameter. So, skip it here before attempting to perform
+ argument deduction. */
+ if ((DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (tmpl)
+ || DECL_BASE_CONSTRUCTOR_P (tmpl))
+ && TYPE_USES_VIRTUAL_BASECLASSES (DECL_CONTEXT (tmpl)))
+ args_without_in_chrg = tree_cons (NULL_TREE,
+ TREE_VALUE (arglist),
+ TREE_CHAIN (TREE_CHAIN (arglist)));
+ else
+ args_without_in_chrg = arglist;
+
+ i = fn_type_unification (tmpl, explicit_targs, targs,
+ args_without_in_chrg,
return_type, strict);
if (i != 0)
TREE_TYPE (t) = build_pointer_type (totype);
args = build_tree_list (NULL_TREE, expr);
if (DECL_HAS_IN_CHARGE_PARM_P (OVL_CURRENT (ctors)))
- args = tree_cons (NULL_TREE, integer_one_node, args);
+ args = tree_cons (NULL_TREE,
+ in_charge_arg_for_name (complete_ctor_identifier),
+ args);
args = tree_cons (NULL_TREE, t, args);
}
for (; ctors; ctors = OVL_NEXT (ctors))
tree explicit_targs = NULL_TREE;
tree basetype, mem_args = NULL_TREE, fns, instance_ptr;
tree pretty_name;
- tree user_args = args;
+ tree user_args;
tree templates = NULL_TREE;
int template_only = 0;
if ((flags & LOOKUP_ONLYCONVERTING)
&& DECL_NONCONVERTING_P (t))
continue;
- if (TREE_CODE (TREE_TYPE (t)) == METHOD_TYPE)
+
+ if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t))
this_arglist = mem_args;
else
this_arglist = args;
returning to the thunk. The first parameter to the thunk is always the
@code{this} pointer; the thunk should add @code{THUNK_DELTA} to this
value. (The @code{THUNK_DELTA} is an @code{int}, not an
-@code{INTEGER_CST}.) Then, the thunk should jump to the location given
+@code{INTEGER_CST}.)
+
+Then, if @code{THUNK_VCALL_OFFSET} (also an @code{int}) is non-zero the
+adjusted @code{this} pointer must be adjusted again. The complete
+calculation is given by the following pseudo-code:
+
+@example
+this += THUNK_DELTA
+if (THUNK_VCALL_OFFSET)
+ this += (*((ptrdiff_t **) this))[THUNK_VCALL_OFFSET]
+@end example
+
+Finally, the thunk should jump to the location given
by @code{DECL_INITIAL}; this will always be an expression for the
address of a function.
--- /dev/null
+// Build don't link:
+// Origin: scott snyder <snyder@fnal.gov>
+
+class d0_Collection_Base {};
+
+template <class T>
+class d0_List
+ : virtual public d0_Collection_Base
+{
+public:
+ d0_List ();
+
+ template <class Input_Iterator>
+ d0_List (Input_Iterator first, Input_Iterator last)
+ ;
+};
+
+void tlist ()
+{
+ const d0_List<int> l4 (1, 2);
+}