diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/decl.c | 2 | ||||
-rw-r--r-- | gcc/cp/lex.c | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 6 |
4 files changed, 19 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index effd434..f446a4f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +Sat Sep 6 10:20:27 1997 Mark Mitchell <mmitchell@usa.net> + + * decl.c (replace_defag): Undo previous change. + * lex.c (do_pending_defargs): Deal with member templates. + + * pt.c (is_member_template): Avoid crashing when passed a + non-function argument. + Fri Sep 5 17:27:38 1997 Jason Merrill <jason@yorick.cygnus.com> * class.c (grow_method): Remove check for redeclaration. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index c77dac8..1e5a56f 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -10070,7 +10070,7 @@ void replace_defarg (arg, init) tree arg, init; { - if (! processing_template_decl && ! uses_template_parms (TREE_VALUE (arg)) + if (! processing_template_decl && ! can_convert_arg (TREE_VALUE (arg), TREE_TYPE (init), init)) cp_pedwarn ("invalid type `%T' for default argument to `%T'", TREE_TYPE (init), TREE_VALUE (arg)); diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 7fca8a2..471033f 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -1873,6 +1873,8 @@ do_pending_defargs () push_nested_class (TREE_PURPOSE (defarg_fns), 1); pushlevel (0); + if (is_member_template (defarg_fn)) + begin_member_template_processing (DECL_TI_ARGS (defarg_fn)); if (TREE_CODE (defarg_fn) == FUNCTION_DECL) { @@ -1899,6 +1901,8 @@ do_pending_defargs () return; } + if (is_member_template (defarg_fn)) + end_member_template_processing (); poplevel (0, 0, 0); pop_nested_class (1); } diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 3620253..a0154e1 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -132,6 +132,12 @@ is_member_template (t) { int r = 0; + if (TREE_CODE (t) != FUNCTION_DECL + && !DECL_FUNCTION_TEMPLATE_P (t)) + /* Anything that isn't a template or a template functon is + certainly not a member template. */ + return 0; + if (DECL_FUNCTION_MEMBER_P (t) || (TREE_CODE (t) == TEMPLATE_DECL && DECL_FUNCTION_MEMBER_P (DECL_TEMPLATE_RESULT (t)))) |