(tsubst_friend_function): Copy it here.
* decl.c (grok_op_properties): Fix typo.
* decl2.c (delete_sanity): Clarify warning, avoid failure on
deleting void*.
* pt.c (check_explicit_specialization): Clarify error.
* decl.c (pushdecl): Also pull out one of the FUNCTION_DECLs from
an old OVERLOAD when we're declaring a non-function.
(pushdecl, destroy_local_var): Check for error_mark_node.
(warn_extern_redeclared_static): Also bail early if
we're a CONST_DECL.
(push_overloaded_decl): Ignore an old error_mark_node.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34652
138bc75d-0d04-0410-961f-
82ee72b054a4
+2000-06-22 Jason Merrill <jason@redhat.com>
+
+ * pt.c (tsubst_decl, case FUNCTION_DECL): Clear DECL_SAVED_TREE.
+ (tsubst_friend_function): Copy it here.
+
+ * decl.c (grok_op_properties): Fix typo.
+
+ * decl2.c (delete_sanity): Clarify warning, avoid failure on
+ deleting void*.
+
+ * pt.c (check_explicit_specialization): Clarify error.
+
+ * decl.c (pushdecl): Also pull out one of the FUNCTION_DECLs from
+ an old OVERLOAD when we're declaring a non-function.
+ (pushdecl, destroy_local_var): Check for error_mark_node.
+ (warn_extern_redeclared_static): Also bail early if
+ we're a CONST_DECL.
+ (push_overloaded_decl): Ignore an old error_mark_node.
+
2000-06-22 Nathan Sidwell <nathan@codesourcery.com>
* call.c (build_x_va_arg): Check if in a template decl.
tree name;
if (TREE_CODE (newdecl) == TYPE_DECL
- || TREE_CODE (newdecl) == TEMPLATE_DECL)
+ || TREE_CODE (newdecl) == TEMPLATE_DECL
+ || TREE_CODE (newdecl) == CONST_DECL)
return;
/* Don't get confused by static member functions; that's a different
actually the same as the function we are declaring. (If
there is one, we have to merge our declaration with the
previous declaration.) */
- if (t && TREE_CODE (t) == OVERLOAD && TREE_CODE (x) == FUNCTION_DECL)
+ if (t && TREE_CODE (t) == OVERLOAD)
{
tree match;
- for (match = t; match; match = OVL_NEXT (match))
- if (DECL_ASSEMBLER_NAME (OVL_CURRENT (t))
- == DECL_ASSEMBLER_NAME (x))
- break;
+ if (TREE_CODE (x) == FUNCTION_DECL)
+ for (match = t; match; match = OVL_NEXT (match))
+ {
+ if (DECL_ASSEMBLER_NAME (OVL_CURRENT (t))
+ == DECL_ASSEMBLER_NAME (x))
+ break;
+ }
+ else
+ /* Just choose one. */
+ match = t;
if (match)
t = OVL_CURRENT (match);
if (TREE_CODE (x) == TYPE_DECL)
{
tree type = TREE_TYPE (x);
- if (DECL_SOURCE_LINE (x) == 0)
+ if (DECL_SOURCE_LINE (x) == 0)
{
if (TYPE_NAME (type) == 0)
TYPE_NAME (type) = x;
tree decl;
if (IDENTIFIER_NAMESPACE_VALUE (name) != NULL_TREE
+ && IDENTIFIER_NAMESPACE_VALUE (name) != error_mark_node
&& (DECL_EXTERNAL (IDENTIFIER_NAMESPACE_VALUE (name))
|| TREE_PUBLIC (IDENTIFIER_NAMESPACE_VALUE (name))))
decl = IDENTIFIER_NAMESPACE_VALUE (name);
return fn;
}
}
+ else if (old == error_mark_node)
+ /* Ignore the undefined symbol marker. */
+ old = NULL_TREE;
else
{
cp_error_at ("previous non-function declaration `%#D'", old);
return;
/* And only things with destructors need cleaning up. */
- if (TYPE_HAS_TRIVIAL_DESTRUCTOR (type))
+ if (type == error_mark_node
+ || TYPE_HAS_TRIVIAL_DESTRUCTOR (type))
return;
if (TREE_CODE (decl) == VAR_DECL &&
break;
case PREDECREMENT_EXPR:
- operator_code = PREDECREMENT_EXPR;
+ operator_code = POSTDECREMENT_EXPR;
break;
default:
/* Deleting ptr to void is undefined behaviour [expr.delete/3]. */
if (TREE_CODE (TREE_TYPE (type)) == VOID_TYPE)
- cp_warning ("`%T' is not a pointer-to-object type", type);
-
+ {
+ cp_warning ("deleting `%T' is undefined", type);
+ doing_vec = 0;
+ }
+
/* An array can't have been allocated by new, so complain. */
if (TREE_CODE (t) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (t, 0)) == VAR_DECL
/* This case handles bogus declarations like template <>
template <class T> void f<int>(); */
- cp_error ("template-id `%D' in declaration of primary template",
- declarator);
+ if (uses_template_parms (declarator))
+ cp_error ("partial specialization `%D' of function template",
+ declarator);
+ else
+ cp_error ("template-id `%D' in declaration of primary template",
+ declarator);
return decl;
}
instantiation of anything. */
DECL_USE_TEMPLATE (new_friend) = 0;
if (TREE_CODE (decl) == TEMPLATE_DECL)
- DECL_USE_TEMPLATE (DECL_TEMPLATE_RESULT (new_friend)) = 0;
+ {
+ DECL_USE_TEMPLATE (DECL_TEMPLATE_RESULT (new_friend)) = 0;
+ DECL_SAVED_TREE (DECL_TEMPLATE_RESULT (new_friend))
+ = DECL_SAVED_TREE (DECL_TEMPLATE_RESULT (decl));
+ }
/* The mangled name for the NEW_FRIEND is incorrect. The call to
tsubst will have resulted in a call to
TREE_CHAIN (r) = NULL_TREE;
DECL_PENDING_INLINE_INFO (r) = 0;
DECL_PENDING_INLINE_P (r) = 0;
+ DECL_SAVED_TREE (r) = NULL_TREE;
TREE_USED (r) = 0;
if (DECL_CLONED_FUNCTION (r))
{