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

.rcc/qmlcache/ generated code is too liberal in its use of std::move()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.7.0 Beta1
    • 6.6, 6.7
    • QML: Tooling
    • None
    • All
    • 3ca5a7b3b (dev)

    Description

      CodeChecker generates dozens of warnings (enough that more serious warnings likely get lost in the noise) about std::move() being used on trivially-copyable types (such as double), which is fatuous and pointless. This probably also provokes warnings from regular compilers. All of which may be noise about something harmless (if pointless), but some of the examples really do look like whatever's generating this code is wildly over-eager in its use of std::move(). For example:

      stdmove of the variable 'r7_1' of the trivially-copyable type 'double' has no effect; remove stdmove()
      
      in file:/home/cc-runs/analyzer_builds/qtdeclarative/src/quickcontrols/material/.rcc/qmlcache/qtquickcontrols2materialstyleplugin_ToolButton_qml.cpp line:1790 col:9
      
      r2_3 = (std::move(r7_1) / std::move(r2_3));
      
      Product:qtdeclarative-dev Severity:MEDIUM Analyzer:clang-tidy Checker:performance-move-const-arg
      Run:qtdeclarative-dev-20230626-90ddb9ef28 Report-hash:364bece03677f8e6e4a5653d55659ae4
      

      As these are generated files, I'm not in a position to actually inspect the generated output (my build tree doesn't contain that file) but the snippet above does look positively silly.

      Is it possible to teach the tool generating this code to be at least a little more restrained about its use of std::move() ?

      Attachments

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              Eddy Edward Welbourne
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes