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

QMetaType::NeedsConstruction does not check what it promises

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.0, 6.1
    • Core: Object Model
    • None

    Description

      QMetaType::NeedsContstruction promises that you can memset the type to zero for initialization. However, we set that flag when QTypeInfo<T>::isComplex is true. For Q_PRIMTIVE_TYPE, that flag is false; however primitive types don't give the guarantee that you can memzero them (see discussion https://lists.qt-project.org/pipermail/development/2020-November/040546.html), only that they can be memcpy'd.

      Attachments

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

        Activity

          People

            fabiankosmale Fabian Kosmale
            fabiankosmale Fabian Kosmale
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes