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

compile error while QSharedPointer<const T>::create()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.11.1
    • 5.7.1, 5.10.0
    • Core: Other
    • None
    • Linux Fedora 25
    • c359df5ca6c70e254de2014d9a7c02c68017f772

    Description

      can't use create method od a QSharedPointer<const T> due to compiler error

       

      #include <QSharedPointer> 
       
      struct A {};
      int main(int argc, char *argv[]) {
      
          auto ca = QSharedPointer<const A>::create(); 
          return 0; 
      }
      

       

      error:

      /usr/include/qt5/QtCore/qsharedpointer_impl.h:439:9: error: 
      invalid conversion from 'const void*' to 'void*' [-fpermissive]
      new (result.data()) T(std::forward<Args>(arguments)...);
      

       

      SO question

      related issue

       

      Attachments

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              bpiee Bartosz Piekarski
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes