Commit 71a19881 by Mark Mitchell Committed by Mark Mitchell

call.c (add_template_candidate_real): Handle member template constructors for…

call.c (add_template_candidate_real): Handle member template constructors for classes with virtual bases.

	* 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.

From-SVN: r34284
parent 885e80cc
2000-05-30 Mark Mitchell <mark@codesourcery.com> 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. * call.c (joust): Fix handling of overloaded builtin operators.
2000-05-30 Zack Weinberg <zack@wolery.cumb.org> 2000-05-30 Zack Weinberg <zack@wolery.cumb.org>
......
...@@ -2141,11 +2141,25 @@ add_template_candidate_real (candidates, tmpl, ctype, explicit_targs, ...@@ -2141,11 +2141,25 @@ add_template_candidate_real (candidates, tmpl, ctype, explicit_targs,
{ {
int ntparms = DECL_NTPARMS (tmpl); int ntparms = DECL_NTPARMS (tmpl);
tree targs = make_tree_vec (ntparms); tree targs = make_tree_vec (ntparms);
tree args_without_in_chrg;
struct z_candidate *cand; struct z_candidate *cand;
int i; int i;
tree fn; 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); return_type, strict);
if (i != 0) if (i != 0)
...@@ -2320,7 +2334,9 @@ build_user_type_conversion_1 (totype, expr, flags) ...@@ -2320,7 +2334,9 @@ build_user_type_conversion_1 (totype, expr, flags)
TREE_TYPE (t) = build_pointer_type (totype); TREE_TYPE (t) = build_pointer_type (totype);
args = build_tree_list (NULL_TREE, expr); args = build_tree_list (NULL_TREE, expr);
if (DECL_HAS_IN_CHARGE_PARM_P (OVL_CURRENT (ctors))) 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); args = tree_cons (NULL_TREE, t, args);
} }
for (; ctors; ctors = OVL_NEXT (ctors)) for (; ctors; ctors = OVL_NEXT (ctors))
...@@ -4229,7 +4245,7 @@ build_new_method_call (instance, name, args, basetype_path, flags) ...@@ -4229,7 +4245,7 @@ build_new_method_call (instance, name, args, basetype_path, flags)
tree explicit_targs = NULL_TREE; tree explicit_targs = NULL_TREE;
tree basetype, mem_args = NULL_TREE, fns, instance_ptr; tree basetype, mem_args = NULL_TREE, fns, instance_ptr;
tree pretty_name; tree pretty_name;
tree user_args = args; tree user_args;
tree templates = NULL_TREE; tree templates = NULL_TREE;
int template_only = 0; int template_only = 0;
...@@ -4374,7 +4390,8 @@ build_new_method_call (instance, name, args, basetype_path, flags) ...@@ -4374,7 +4390,8 @@ build_new_method_call (instance, name, args, basetype_path, flags)
if ((flags & LOOKUP_ONLYCONVERTING) if ((flags & LOOKUP_ONLYCONVERTING)
&& DECL_NONCONVERTING_P (t)) && DECL_NONCONVERTING_P (t))
continue; continue;
if (TREE_CODE (TREE_TYPE (t)) == METHOD_TYPE)
if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t))
this_arglist = mem_args; this_arglist = mem_args;
else else
this_arglist = args; this_arglist = args;
......
...@@ -1038,7 +1038,19 @@ returns, control is transferred directly to the caller, without ...@@ -1038,7 +1038,19 @@ returns, control is transferred directly to the caller, without
returning to the thunk. The first parameter to the thunk is always the 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 @code{this} pointer; the thunk should add @code{THUNK_DELTA} to this
value. (The @code{THUNK_DELTA} is an @code{int}, not an 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 by @code{DECL_INITIAL}; this will always be an expression for the
address of a function. address of a function.
......
// 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);
}
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