OSDN Git Service

PR c++/13268, c++/13339
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 25 Dec 2003 16:28:50 +0000 (16:28 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 25 Dec 2003 16:28:50 +0000 (16:28 +0000)
        * class.c (add_method): Return early when method is error_mark_node.
        * pt.c (tsubst_friend_function): Return early when new_friend is
        error_mark_node.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75022 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/pt.c

index 9d13f3d..4adb918 100644 (file)
@@ -1,3 +1,10 @@
+2003-12-25  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR c++/13268, c++/13339
+       * class.c (add_method): Return early when method is error_mark_node.
+       * pt.c (tsubst_friend_function): Return early when new_friend is
+       error_mark_node.
+
 2003-12-23  Mark Mitchell  <mark@codesourcery.com>
 
        * cp-lang.c (cp_expr_size): Return zero for empty classes.
index d110295..2928dd3 100644 (file)
@@ -725,12 +725,18 @@ modify_vtable_entry (tree t,
 void
 add_method (tree type, tree method, int error_p)
 {
-  int using = (DECL_CONTEXT (method) != type);
+  int using;
   int len;
   int slot;
   tree method_vec;
-  int template_conv_p = (TREE_CODE (method) == TEMPLATE_DECL
-                        && DECL_TEMPLATE_CONV_FN_P (method));
+  int template_conv_p;
+
+  if (method == error_mark_node)
+    return;
+  
+  using = (DECL_CONTEXT (method) != type);
+  template_conv_p = (TREE_CODE (method) == TEMPLATE_DECL
+                     && DECL_TEMPLATE_CONV_FN_P (method));
 
   if (!CLASSTYPE_METHOD_VEC (type))
     /* Make a new method vector.  We start with 8 entries.  We must
index e7a8863..3c0e7d8 100644 (file)
@@ -4897,6 +4897,9 @@ tsubst_friend_function (tree decl, tree args)
      
      Then, in S<int>, template <class U> void f(int, U) is not an
      instantiation of anything.  */
+  if (new_friend == error_mark_node)
+    return error_mark_node;
+  
   DECL_USE_TEMPLATE (new_friend) = 0;
   if (TREE_CODE (decl) == TEMPLATE_DECL)
     {