decl2.c (grok_alignof): Don't decay lvalues.

* decl2.c (grok_alignof): Don't decay lvalues.

	* init.c (build_new): Remove unused variable.

From-SVN: r29805
This commit is contained in:
Nathan Sidwell 1999-10-04 15:13:26 +00:00 committed by Nathan Sidwell
parent d38e58a5ab
commit ce7695e001
3 changed files with 7 additions and 17 deletions

View File

@ -1,3 +1,9 @@
1999-10-04 Nathan Sidwell <nathan@acm.org>
* decl2.c (grok_alignof): Don't decay lvalues.
* init.c (build_new): Remove unused variable.
1999-10-04 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (struct language_function): Remove static_labelno.

View File

@ -1050,17 +1050,7 @@ grok_alignof (expr)
return c_alignof (TREE_TYPE (TREE_TYPE (best)));
}
else
{
/* ANSI says arrays and fns are converted inside comma.
But we can't convert them in build_compound_expr
because that would break commas in lvalues.
So do the conversion here if operand was a comma. */
if (TREE_CODE (expr) == COMPOUND_EXPR
&& (TREE_CODE (TREE_TYPE (expr)) == ARRAY_TYPE
|| TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE))
expr = default_conversion (expr);
return c_alignof (TREE_TYPE (expr));
}
return c_alignof (TREE_TYPE (expr));
}
/* Create an ARRAY_REF, checking for the user doing things backwards

View File

@ -1895,8 +1895,6 @@ build_new (placement, decl, init, use_global_new)
tree nelts = NULL_TREE, t;
int has_array = 0;
tree pending_sizes = NULL_TREE;
if (decl == error_mark_node)
return error_mark_node;
@ -2054,10 +2052,6 @@ build_new (placement, decl, init, use_global_new)
rval = build1 (NOP_EXPR, TREE_TYPE (rval), rval);
TREE_NO_UNUSED_WARNING (rval) = 1;
if (pending_sizes)
rval = build_compound_expr (chainon (pending_sizes,
build_expr_list (NULL_TREE, rval)));
return rval;
}