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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.7.1, 5.10.0
    • Fix Version/s: 5.11.1
    • Component/s: Core: Other
    • Labels:
      None
    • Environment:
      Linux Fedora 25
    • Commits:
      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

              • Assignee:
                thiago Thiago Macieira
                Reporter:
                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