Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-21892

Clang Code Model: False Positive: Semantic Issue

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: Qt Creator 4.8.1, Qt Creator 4.9.0-beta1
    • Fix Version/s: None
    • Component/s: C/C++/Obj-C++ Support
    • Labels:
      None
    • Platform/s:
      Windows
    • Commits:
      dba0adcfe0fec308a047cca79b1be0b1436f6fad (clang/clang/release_70-based)

      Description

      See this header file as an example:

      #pragma once
      
      #include <thisHeaderDoesNotExistByIntention.h>    // remove this  line
      #include <QString>                                // or: remove this line
      
      #include <QScopedPointer>
      
      struct ClassP;
      
      class Class // : public boost::noncopyable
         {
         public:
      
         private:
      
            QScopedPointer<ClassP>   _d;
         };
      
      
      

       This is shown in the editor as:

      If you remove (comment out) the first or the second marked line (3 or 4) then the false positive in 18 is removed.

      Ok, if you remove the include of the non existing file, I would by it.

      But if you remove the include of QString?

      Anyway, a missing file should not bring the analyzing to this result, should it?

      You can remove the false positive by swapping line 6 and 4, so that include QScopedPointer is in front of QString, too.

       

       

        Attachments

          Issue Links

          For Gerrit Dashboard: QTCREATORBUG-21892
          # Subject Branch Project Status CR V

            Activity

              People

              • Assignee:
                kosjar Nikolai Kosjar
                Reporter:
                moellney Michael Möllney
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes