* pt.c (unify): Remove restrictions on deduction of argument
of template template parameters.
* rtti.c (build_dynamic_cast_1): Resolve OFFSET_REF exprs.
* class.c (resolve_address_of_overloaded_function): Show list of
all candidates, when none of them match.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24749
138bc75d-0d04-0410-961f-
82ee72b054a4
+1999-01-18 Jason Merrill <jason@yorick.cygnus.com>
+
+ * tree.c (copy_template_template_parm): Use permanent_obstack.
+
+1999-01-18 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
+
+ * pt.c (unify): Remove restrictions on deduction of argument
+ of template template parameters.
+
+1999-01-18 Nathan Sidwell <nathan@acm.org>
+
+ * rtti.c (build_dynamic_cast_1): Resolve OFFSET_REF exprs.
+
+ * class.c (resolve_address_of_overloaded_function): Show list of
+ all candidates, when none of them match.
+
1999-01-18 Chip Salzenberg <chip@perlsupport.com>
* typeck.c (comp_ptr_ttypes_reinterpret): Per ANSI, tighten up
/* Functions related to building classes and their related objects.
- Copyright (C) 1987, 92-97, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1987, 92-97, 1998, 1999 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
This file is part of GNU CC.
/* There were *no* matches. */
if (complain)
{
- cp_error ("cannot convert overloaded function `%D' to type `%#T'",
+ cp_error ("no matches converting function `%D' to type `%#T'",
DECL_NAME (OVL_FUNCTION (overload)),
target_type);
- cp_error ("because no suitable overload exists");
+
+ /* print_candidates expects a chain with the functions in
+ TREE_VALUE slots, so we cons one up here (we're losing anyway,
+ so why be clever?). */
+ for (; overload; overload = OVL_NEXT (overload))
+ matches = scratch_tree_cons (NULL_TREE, OVL_CURRENT (overload),
+ matches);
+
+ print_candidates (matches);
}
return error_mark_node;
}
== error_mark_node)
return 1;
- /* Deduce arguments T, i from TT<T> or TT<i>. */
+ /* Deduce arguments T, i from TT<T> or TT<i>.
+ We check each element of PARMVEC and ARGVEC individually
+ rather than the whole TREE_VEC since they can have
+ different number of elements. */
+
for (i = 0; i < TREE_VEC_LENGTH (parmvec); ++i)
{
tree t = TREE_VEC_ELT (parmvec, i);
- if (TREE_CODE (t) != TEMPLATE_TYPE_PARM
- && TREE_CODE (t) != TEMPLATE_TEMPLATE_PARM
- && TREE_CODE (t) != TEMPLATE_PARM_INDEX)
- continue;
-
- /* This argument can be deduced. */
if (unify (tparms, targs, t,
TREE_VEC_ELT (argvec, i),
tree type, expr;
{
enum tree_code tc = TREE_CODE (type);
- tree exprtype = TREE_TYPE (expr);
+ tree exprtype;
enum tree_code ec;
tree dcast_fn;
tree old_expr = expr;
+ if (TREE_CODE (expr) == OFFSET_REF)
+ expr = resolve_offset_ref (expr);
+
+ exprtype = TREE_TYPE (expr);
assert (exprtype != NULL_TREE);
ec = TREE_CODE (exprtype);
tree t;
{
tree template = TYPE_NAME (t);
- tree t2 = make_lang_type (TEMPLATE_TEMPLATE_PARM);
+ tree t2;
+
+ /* Make sure these end up on the permanent_obstack. */
+ push_obstacks_nochange ();
+ end_temporary_allocation ();
+
+ t2 = make_lang_type (TEMPLATE_TEMPLATE_PARM);
template = copy_node (template);
copy_lang_decl (template);
+
+ pop_obstacks ();
+
TREE_TYPE (template) = t2;
TYPE_NAME (t2) = template;
TYPE_STUB_DECL (t2) = template;