diff options
author | Mark Mitchell <mmitchell@usa.net> | 1997-09-06 20:10:05 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1997-09-06 16:10:05 -0400 |
commit | aa5f3bad3a1a833d383489c3c4da2c0d6d248680 (patch) | |
tree | f865afaaa550653569b0d7ac063bd7f7dc9c4bc8 /gcc | |
parent | 98c1c668807d74ad4dfab8c0413499b31f638258 (diff) | |
download | gcc-aa5f3bad3a1a833d383489c3c4da2c0d6d248680.zip gcc-aa5f3bad3a1a833d383489c3c4da2c0d6d248680.tar.gz gcc-aa5f3bad3a1a833d383489c3c4da2c0d6d248680.tar.bz2 |
decl.c (replace_defag): Undo previous change.
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.
From-SVN: r15131
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)))) |