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

Clang warnings about =delete(reason) being a C++ 26 extension

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.9
    • 6.9
    • Core: Other
    • None
    • Windows
    • d9d4d15aef

    Description

      When compiling the dev branch with clang-cl 19.1, Clang emits the following warning:

      G:/Dev/qt-build/qtbase/src/corelib/text/qstring.h(1018,45): warning: '= delete' with a message is a C++2c extension [-Wc++26-extensions]
       1018 |     QString &operator=(const QByteArray &a) QSTRING_DECL_DELETED_ASCII_OP;
            |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      G:/Dev/qt-build/qtbase/src/corelib/text/qstring.h(1012,58): note: expanded from macro 'QSTRING_DECL_DELETED_ASCII_OP'
       1012 | #define QSTRING_DECL_DELETED_ASCII_OP Q_DECL_EQ_DELETE_X("This function is not available under QT_NO_CAST_FROM_ASCII")
            |                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      G:/Dev/qt-build/qtbase/src/corelib/global/qcompilerdetection.h(1028,49): note: expanded from macro 'Q_DECL_EQ_DELETE_X'
       1028 | #    define Q_DECL_EQ_DELETE_X(reason) = delete(reason)
            |                                                 ^~~~~~
      

      I didn't test it on Linux/macOS, but I'd guess it emits the same warning. Support for = delete(reason) is detected through __cpp_deleted_function >= 202403L. This might be a Clang bug.

      Since this is in qstring.h, the whole output is filled with this error.

      Attachments

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

        Activity

          People

            moheim Moss Heim
            nerixyz Tom Fors
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes