diff options
author | Jason Merrill <jason@redhat.com> | 2001-01-02 22:28:51 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2001-01-02 22:28:51 -0500 |
commit | f30efcb78a1e867cd78017f872dd0c2a1064adfb (patch) | |
tree | 283386e3c949a3a24ebf975086eb02c0d52e8c32 /gcc/cp/typeck2.c | |
parent | a412bf75d904604bc4cb05e888663ad70e4008cf (diff) | |
download | gcc-f30efcb78a1e867cd78017f872dd0c2a1064adfb.zip gcc-f30efcb78a1e867cd78017f872dd0c2a1064adfb.tar.gz gcc-f30efcb78a1e867cd78017f872dd0c2a1064adfb.tar.bz2 |
init.c (build_default_init): New fn.
* init.c (build_default_init): New fn.
(perform_member_init): Split out from here.
(build_new_1): Use it. Simplify initialization logic.
(build_vec_init): Take an array, rather than a pointer and maxindex.
Speed up simple initializations. Don't clean up if we're assigning.
* cp-tree.h: Adjust.
* decl2.c (do_static_initialization): Remove TREE_VEC case.
* parse.y (new_initializer): Return void_zero_node for ().
* typeck.c (build_modify_expr): Handle getting a CONSTRUCTOR.
* typeck2.c (digest_init): Only complain about user-written
CONSTRUCTORs.
From-SVN: r38643
Diffstat (limited to 'gcc/cp/typeck2.c')
-rw-r--r-- | gcc/cp/typeck2.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index c40b81c..62b384a 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -581,7 +581,8 @@ digest_init (type, init, tail) if (code == ARRAY_TYPE || IS_AGGR_TYPE_CODE (code)) { - if (raw_constructor && TYPE_NON_AGGREGATE_CLASS (type)) + if (raw_constructor && TYPE_NON_AGGREGATE_CLASS (type) + && TREE_HAS_CONSTRUCTOR (init)) { cp_error ("subobject of type `%T' must be initialized by constructor, not by `%E'", type, init); |