decl.c (expand_static_init): Tweak handling of static initializations for objects without constructors.
* decl.c (expand_static_init): Tweak handling of static initializations for objects without constructors. From-SVN: r29093
This commit is contained in:
parent
483dd5bec1
commit
951525d2ed
3 changed files with 15 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
1999-09-03 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* decl.c (expand_static_init): Tweak handling of static
|
||||
initializations for objects without constructors.
|
||||
|
||||
1999-09-03 Nathan Sidwell <nathan@acm.org>
|
||||
|
||||
* typeck.c (build_indirect_ref): Reject dereference of pointer to
|
||||
|
|
|
@ -8181,7 +8181,9 @@ expand_static_init (decl, init)
|
|||
|| (init && TREE_CODE (init) == TREE_LIST))
|
||||
assignment = build_aggr_init (decl, init, 0);
|
||||
else if (init)
|
||||
assignment = build_modify_expr (decl, NOP_EXPR, init);
|
||||
/* The initialization we're doing here is just a bitwise
|
||||
copy. */
|
||||
assignment = build (INIT_EXPR, TREE_TYPE (decl), decl, init);
|
||||
else
|
||||
assignment = NULL_TREE;
|
||||
|
||||
|
|
7
gcc/testsuite/g++.old-deja/g++.other/static6.C
Normal file
7
gcc/testsuite/g++.old-deja/g++.other/static6.C
Normal file
|
@ -0,0 +1,7 @@
|
|||
// Build don't link:
|
||||
// Origin: Jason Merrill <jason@cygnus.com>
|
||||
|
||||
void f (int i)
|
||||
{
|
||||
static int a[] = { i };
|
||||
}
|
Loading…
Add table
Reference in a new issue