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

Clang Code Model: False Positive: Semantic Issue

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • None
    • Qt Creator 4.8.1, Qt Creator 4.9.0-beta1
    • C/C++/Obj-C++ Support
    • None
    • Windows
    • dba0adcfe0fec308a047cca79b1be0b1436f6fad (clang/clang/release_70-based)

      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.

       

       

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

            kosjar Nikolai Kosjar
            moellney Michael Möllney
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes