Uploaded image for project: 'Qt Safe Renderer'
  1. Qt Safe Renderer
  2. QSR-2384

Fix Clang-tidy warning in QSR runtime

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • QSR 2.1 Beta 3
    • QSR 2.1
    • Runtime
    • None

    Description

      This warning comes from QSafeLayoutReader::readData function and the reason behind is that the function is a virtual function and is called during the construction of an object. A possible fix for this could be using a non-virtual function or delay the call of the function after the object is fully constructed.

      C:\Users\aarotone\Workspace\qtsaferenderer-runtime\src\saferenderer\qsafelayoutresourcereader.cpp:88:35: warning: Call to virtual method 'QSafeLayoutResourceReader::readDataFromFile' during construction bypasses virtual dispatch [clang-analyzer-optin.cplusplus.VirtualCall]
      1: Calling 'QSafeLayoutResourceReader::readData' in C:\Users\aarotone\Workspace\qtsaferenderer-runtime\src\saferenderer\qsafelayoutresourcereader.cpp:81
      2: Call to virtual method 'QSafeLayoutResourceReader::readDataFromFile' during construction bypasses virtual dispatch in C:\Users\aarotone\Workspace\qtsaferenderer-runtime\src\saferenderer\qsafelayoutresourcereader.cpp:88
      C:\Users\aarotone\Workspace\qtsaferenderer-runtime\src\saferenderer\qsafelayoutresourcereader.cpp:81:5: Calling 'QSafeLayoutResourceReader::readData'
      C:\Users\aarotone\Workspace\qtsaferenderer-runtime\src\saferenderer\qsafelayoutresourcereader.cpp:88:35: Call to virtual method 'QSafeLayoutResourceReader::readDataFromFile' during construction bypasses virtual dispatch
      C:\Users\aarotone\Workspace\qtsaferenderer-runtime\src\saferenderer\qsafelayoutresourcereader.cpp:88:35: Call to virtual method 'QSafeLayoutResourceReader::readDataFromFile' during construction bypasses virtual dispatch [clang-analyzer-optin.cplusplus.VirtualCall]

      Attachments

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

        Activity

          People

            aarotone Aapo Rotonen
            aarotone Aapo Rotonen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes