mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-12 10:57:13 +08:00
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:
parent
d38e58a5ab
commit
ce7695e001
@ -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>
|
1999-10-04 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
* cp-tree.h (struct language_function): Remove static_labelno.
|
* cp-tree.h (struct language_function): Remove static_labelno.
|
||||||
|
@ -1050,17 +1050,7 @@ grok_alignof (expr)
|
|||||||
return c_alignof (TREE_TYPE (TREE_TYPE (best)));
|
return c_alignof (TREE_TYPE (TREE_TYPE (best)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
return c_alignof (TREE_TYPE (expr));
|
||||||
/* 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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create an ARRAY_REF, checking for the user doing things backwards
|
/* Create an ARRAY_REF, checking for the user doing things backwards
|
||||||
|
@ -1895,8 +1895,6 @@ build_new (placement, decl, init, use_global_new)
|
|||||||
tree nelts = NULL_TREE, t;
|
tree nelts = NULL_TREE, t;
|
||||||
int has_array = 0;
|
int has_array = 0;
|
||||||
|
|
||||||
tree pending_sizes = NULL_TREE;
|
|
||||||
|
|
||||||
if (decl == error_mark_node)
|
if (decl == error_mark_node)
|
||||||
return 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);
|
rval = build1 (NOP_EXPR, TREE_TYPE (rval), rval);
|
||||||
TREE_NO_UNUSED_WARNING (rval) = 1;
|
TREE_NO_UNUSED_WARNING (rval) = 1;
|
||||||
|
|
||||||
if (pending_sizes)
|
|
||||||
rval = build_compound_expr (chainon (pending_sizes,
|
|
||||||
build_expr_list (NULL_TREE, rval)));
|
|
||||||
|
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user