]> gcc.gnu.org Git - gcc.git/commitdiff
decl.c (replace_defag): Undo previous change.
authorMark Mitchell <mmitchell@usa.net>
Sat, 6 Sep 1997 20:10:05 +0000 (20:10 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 6 Sep 1997 20:10:05 +0000 (16:10 -0400)
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

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/lex.c
gcc/cp/pt.c

index effd43423c1d859a996dde963235e4764468e87a..f446a4f59475a9bfec382f80e10a40fc780431bc 100644 (file)
@@ -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.
index c77dac80396cfca91286f6abf28aaaf2a2419a97..1e5a56f40dea4f9386770114a573b47aa803da23 100644 (file)
@@ -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));
index 7fca8a2138d430913d03940d50d772aa1b347db8..471033faf9e8eb8641611d53187582c3e2fbe4c4 100644 (file)
@@ -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);
     }
index 3620253a6b5848f9247c73a683777b8a2c65d529..a0154e173eff0046ea562f91709b3ea49e4dd20b 100644 (file)
@@ -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))))
This page took 0.107344 seconds and 5 git commands to generate.