Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-10978

QVarLengthArray assignment operator regression

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P0: Blocker
    • 4.6.3
    • 4.6.3, 4.7.0
    • None
    • Ubuntu 8.10
      2.6.24-27-generic #1 SMP Wed Mar 24 10:04:52 UTC 2010 i686 GNU/Linux
    • 8060094144d6104659b8ce3b88d6f8b1e53cfb59

    Description

      In Qt 4.7.0-beta1 the assignment operator for QVarLengthArray has a wrong behaviour, it appends instead of replacing the data. It was working OK in previous Qt versions as far as I can tell.
      Example code (attached as qmake project):

      #include <QtCore/QCoreApplication>
      #include <QVarLengthArray>
      #include <QDebug>
      
      struct A
      {
      	A() : a(false) {;}
      	bool a;
      };
      
      int main(int , char *[])
      {
      	QVarLengthArray<A,8 > sides1;
      	sides1.resize(6);
      	QVarLengthArray<A,8 > sides2;
      	sides2.resize(7);
      	sides2 = sides1;
      	qDebug() << sides1.size() << sides2.size();
      	Q_ASSERT(sides1.size()==sides2.size());
      	
      	// Output: 6 13
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            biochimia João Abecasis
            xalioth Fabien Chéreau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes