-2002-02-20 Release Manager
+2002-03-18 Jason Merrill <jason@redhat.com>
- * GCC 3.0.4 Released.
+ PR c++/4377
+ * mangle.c (write_expression): Strip NOP_EXPRs sooner. Also strip
+ NON_LVALUE_EXPRs.
+
+ PR c++/4003
+ * pt.c (tsubst_friend_function): Use decl_namespace_context.
+
+2002-03-17 Jason Merrill <jason@redhat.com>
+
+ PR c++/5757
+ * init.c (build_new_1): Pass the right pointer to op delete.
2002-02-20 Release Manager
tree cleanup;
int flags = (LOOKUP_NORMAL
| (globally_qualified_p * LOOKUP_GLOBAL));
+ tree delete_node;
+
+ if (use_cookie)
+ /* Subtract the padding back out to get to the pointer returned
+ from operator new. */
+ delete_node = fold (build (MINUS_EXPR, TREE_TYPE (alloc_node),
+ alloc_node, cookie_size));
+ else
+ delete_node = alloc_node;
/* The Standard is unclear here, but the right thing to do
is to use the same method for finding deallocation
functions that we use for finding allocation functions. */
flags |= LOOKUP_SPECULATIVELY;
- cleanup = build_op_delete_call (dcode, alloc_node, size, flags,
+ cleanup = build_op_delete_call (dcode, delete_node, size, flags,
(placement_allocation_fn_p
? alloc_call : NULL_TREE));
code = TREE_CODE (expr);
}
+ /* Skip NOP_EXPRs. They can occur when (say) a pointer argument
+ is converted (via qualification conversions) to another
+ type. */
+ while (TREE_CODE (expr) == NOP_EXPR
+ || TREE_CODE (expr) == NON_LVALUE_EXPR)
+ {
+ expr = TREE_OPERAND (expr, 0);
+ code = TREE_CODE (expr);
+ }
+
/* Handle template parameters. */
if (code == TEMPLATE_TYPE_PARM
|| code == TEMPLATE_TEMPLATE_PARM
{
int i;
- /* Skip NOP_EXPRs. They can occur when (say) a pointer argument
- is converted (via qualification conversions) to another
- type. */
- while (TREE_CODE (expr) == NOP_EXPR)
- {
- expr = TREE_OPERAND (expr, 0);
- code = TREE_CODE (expr);
- }
-
/* When we bind a variable or function to a non-type template
argument with reference type, we create an ADDR_EXPR to show
the fact that the entity's address has been taken. But, we
tree template_id, arglist, fns;
tree new_args;
tree tmpl;
- tree ns = CP_DECL_CONTEXT (TYPE_MAIN_DECL (current_class_type));
+ tree ns = decl_namespace_context (TYPE_MAIN_DECL (current_class_type));
/* Friend functions are looked up in the containing namespace scope.
We must enter that scope, to avoid finding member functions of the