init.c (build_vec_init): Test for trivial copy-assignment when copy-assigning arrays.
authorAlexandre Oliva <aoliva@redhat.com>
Tue, 21 May 2002 17:26:18 +0000 (17:26 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Tue, 21 May 2002 17:26:18 +0000 (17:26 +0000)
* init.c (build_vec_init): Test for trivial copy-assignment when
copy-assigning arrays.

From-SVN: r53691

gcc/cp/ChangeLog
gcc/cp/init.c

index 09f038c0a081af0f76b1d9ccbb698cb0eeab8dee..cd76ef214e54e6db79d533dc3be5a51a15589f79 100644 (file)
@@ -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.
index 526d68f390b2b396276789ab45b84cd5a7e07f0a..b8ec78a28fbb7d99ff77942b52e86620d62533d8 100644 (file)
@@ -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.  */