Commit ac2b3222 by Andrew Pinski Committed by Andrew Pinski

PR c++/13268, c++/13339

        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.

From-SVN: r75022
parent 5a6159dd
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> 2003-12-23 Mark Mitchell <mark@codesourcery.com>
* cp-lang.c (cp_expr_size): Return zero for empty classes. * cp-lang.c (cp_expr_size): Return zero for empty classes.
......
...@@ -725,12 +725,18 @@ modify_vtable_entry (tree t, ...@@ -725,12 +725,18 @@ modify_vtable_entry (tree t,
void void
add_method (tree type, tree method, int error_p) add_method (tree type, tree method, int error_p)
{ {
int using = (DECL_CONTEXT (method) != type); int using;
int len; int len;
int slot; int slot;
tree method_vec; tree method_vec;
int template_conv_p = (TREE_CODE (method) == TEMPLATE_DECL int template_conv_p;
&& DECL_TEMPLATE_CONV_FN_P (method));
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)) if (!CLASSTYPE_METHOD_VEC (type))
/* Make a new method vector. We start with 8 entries. We must /* Make a new method vector. We start with 8 entries. We must
......
...@@ -4897,6 +4897,9 @@ tsubst_friend_function (tree decl, tree args) ...@@ -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 Then, in S<int>, template <class U> void f(int, U) is not an
instantiation of anything. */ instantiation of anything. */
if (new_friend == error_mark_node)
return error_mark_node;
DECL_USE_TEMPLATE (new_friend) = 0; DECL_USE_TEMPLATE (new_friend) = 0;
if (TREE_CODE (decl) == TEMPLATE_DECL) if (TREE_CODE (decl) == TEMPLATE_DECL)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment