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

[qmltc] repeater generates invalid code

    XMLWordPrintable

Details

    • be104adfb5 (qt/qtdeclarative/dev) be104adfb5 (qt/tqtc-qtdeclarative/dev) f60ed66cb5 (qt/qtdeclarative/6.4) f60ed66cb5 (qt/tqtc-qtdeclarative/6.4)

    Description

      Item {
          property int count: 4
      
          Repeater {
              model: count
      
              MainComponent{
              }
          }
      }
      

      with qt-6.3 the generated code compiled. with qt-6.4 i get:

      /home/tim/build/build-qt-bug-gcc_12-Debug/.qmltc/BugCore/main.h: In static member function ‘static constexpr uint main::q_qmltc_typeCount()’:
      /home/tim/build/build-qt-bug-gcc_12-Debug/.qmltc/BugCore/main.h:107:54: error: ‘main_Repeater_MainComponent’ was not declared in this scope
        107 |     return 1 + QQmltcObjectCreationHelper::typeCount<main_Repeater_MainComponent>();
            |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      /home/tim/build/build-qt-bug-gcc_12-Debug/.qmltc/BugCore/main.h:107:82: error: no matching function for call to ‘QQmltcObjectCreationHelper::typeCount<<expression error> >()’
        107 |     return 1 + QQmltcObjectCreationHelper::typeCount<main_Repeater_MainComponent>();
            |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
      In file included from /home/tim/build/build-qt-bug-gcc_12-Debug/.qmltc/BugCore/main.h:15:
      /home/tim/bin/qt-6.4.0/include/QtQml/6.4.0/QtQml/private/qqmltcobjectcreationhelper_p.h:82:27: note: candidate: ‘template<class T> static constexpr uint QQmltcObjectCreationHelper::typeCount()’
         82 |     static constexpr uint typeCount() noexcept
            |                           ^~~~~~~~~
      /home/tim/bin/qt-6.4.0/include/QtQml/6.4.0/QtQml/private/qqmltcobjectcreationhelper_p.h:82:27: note:   template argument deduction/substitution failed:
      /home/tim/build/build-qt-bug-gcc_12-Debug/.qmltc/BugCore/main.h:107:82: error: template argument 1 is invalid
        107 |     return 1 + QQmltcObjectCreationHelper::typeCount<main_Repeater_MainComponent>();
            |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
      [9/11 1.2/sec] Building CXX object CMakeFiles/BugCore.dir/.qmltc/BugCore/main.cpp.o
      

      Attachments

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

        Activity

          People

            sami.shalayel Sami Shalayel
            timblechmann tim blechmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes