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

False Positives "unknown types" with Clang Code Model

XMLWordPrintable

    • Windows
    • 951aee8f3a79b0ae66255c9bd1712970ca857299 (qt-creator/qt-creator/4.8)

      Using the clang code model I get false positives depending on the #include order

       

      #include <QCoreApplication>
      
      // exclude this include and CLANG Code Model is happy...
      // BOOST version 1.52
      #include <boost/math/complex/asin.hpp>
      
      #include <QDir>
      #include <QTextStream>
      
      
      int main(int argc, char *argv[])
         {
         QCoreApplication a(argc, argv);
      
         QDir myDir("Aha");
         QTextStream myTestStream;
      
         return a.exec();
         }
      
      

       

      When including asin.hpp of BOOST 1.52 I get:

      QDir and QTextStream are "unknown" even though they are included. Needless to say, that with "F1" I do not get any help on QDir or QTextStream in the Help sidepanel.

      "F2" does not get me to the declarations.

      But when excluding the include of asin.hpp QDir and QTextStream are recognized by the code model:

       

      And now the "funny" part:
      If I move the includes for QDir and QStream in front of the active include of asin.hpp the code model recognizes QDir and QStream, too!

       

      So somehow the asin.hpp disturbes the clang code model?

        1. image-2018-12-11-10-04-31-941.png
          47 kB
          Michael Möllney
        2. image-2018-12-11-10-09-01-476.png
          51 kB
          Michael Möllney
        3. image-2018-12-11-10-12-59-891.png
          53 kB
          Michael Möllney
        4. QTCREATORBUG-21685.zip
          0.7 kB
          Julius Bullinger
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            yvvan Ivan Donchevskii
            moellney Michael Möllney
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes