diff options
author | Jason Merrill <jason@gcc.gnu.org> | 1999-01-18 08:32:57 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1999-01-18 08:32:57 -0500 |
commit | 6b9b6b150929c20219227d06a968579480447c6b (patch) | |
tree | caed3e0e0187aeb4acee92101e0ae17ac5d85192 /gcc | |
parent | ddaed37e0437fb5d5c9446139d4938d3e51532cb (diff) | |
download | gcc-6b9b6b150929c20219227d06a968579480447c6b.zip gcc-6b9b6b150929c20219227d06a968579480447c6b.tar.gz gcc-6b9b6b150929c20219227d06a968579480447c6b.tar.bz2 |
tree.c (copy_template_template_parm): Use permanent_obstack.
* tree.c (copy_template_template_parm): Use permanent_obstack.
* 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.
From-SVN: r24749
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/cp/class.c | 14 | ||||
-rw-r--r-- | gcc/cp/pt.c | 12 | ||||
-rw-r--r-- | gcc/cp/rtti.c | 6 | ||||
-rw-r--r-- | gcc/cp/tree.c | 11 |
5 files changed, 47 insertions, 12 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index dfe2645..9e1a1d8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,19 @@ +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 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 1688e02..622f079 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -1,5 +1,5 @@ /* 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. @@ -5188,10 +5188,18 @@ resolve_address_of_overloaded_function (target_type, /* 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; } diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index a28751b..ad0acae 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -7461,16 +7461,14 @@ unify (tparms, targs, parm, arg, strict, explicit_mask) == 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), diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index a4b35ec..fff9230 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -456,11 +456,15 @@ build_dynamic_cast_1 (type, expr) 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); diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index fdf46cf..85cd968 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1519,9 +1519,18 @@ copy_template_template_parm (t) 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; |