diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2002-05-21 17:26:18 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2002-05-21 17:26:18 +0000 |
commit | c8a3d8890e4548cf07c8aa01fbc5716e23364b51 (patch) | |
tree | 97369d0e84807bab9ae8853a9c382de8df24f0dd | |
parent | 2870428fc8165fba7c69af1c56136935172e44d8 (diff) | |
download | gcc-c8a3d8890e4548cf07c8aa01fbc5716e23364b51.zip gcc-c8a3d8890e4548cf07c8aa01fbc5716e23364b51.tar.gz gcc-c8a3d8890e4548cf07c8aa01fbc5716e23364b51.tar.bz2 |
init.c (build_vec_init): Test for trivial copy-assignment when copy-assigning arrays.
* init.c (build_vec_init): Test for trivial copy-assignment when
copy-assigning arrays.
From-SVN: r53691
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/init.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 09f038c..cd76ef2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2002-05-21 Alexandre Oliva <aoliva@redhat.com> + + * init.c (build_vec_init): Test for trivial copy-assignment when + copy-assigning arrays. + 2002-05-20 Andreas Jaeger <aj@suse.de> * init.c (build_default_init): Remove unused variable. diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 526d68f..b8ec78a 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -2774,7 +2774,10 @@ build_vec_init (base, init, from_array) if (init && TREE_CODE (init) == CONSTRUCTOR && TREE_TYPE (init) == NULL_TREE) init = digest_init (atype, init, 0); - if (init && !TYPE_NEEDS_CONSTRUCTING (type) + if (init + && (from_array == 2 + ? (!CLASS_TYPE_P (type) || !TYPE_HAS_COMPLEX_ASSIGN_REF (type)) + : !TYPE_NEEDS_CONSTRUCTING (type)) && ((TREE_CODE (init) == CONSTRUCTOR /* Don't do this if the CONSTRUCTOR might contain something that might throw and require us to clean up. */ |