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

QtCreator doesn't find usages for auto variables

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P2: Important P2: Important
    • Qt Creator 4.13.0-beta1
    • Qt Creator 4.0.0-beta1, Qt Creator 4.6.0-beta1
    • C/C++/Obj-C++ Support
    • Windows 7, clang 3.6.2 C++ code model
    • 40173ad4ab86f0a49d0bb091f654bdf7220931f5 (qt-creator/qt-creator/master)

      Given the code

      #include <iostream>
      #include <QSharedPointer>
      
      class Foobar
      {
      public:
          int foo;
      };
      
      void testFoobar()
      {
          QSharedPointer<Foobar> f(new Foobar);
          f->foo = 20;
      
          std::cout << __FUNCTION__ << ": " << f->foo << std::endl;
      }
      
      void testFoobarAuto()
      {
          auto f = QSharedPointer<Foobar>(new Foobar);
          f->foo = 30;
      
          std::cout << __FUNCTION__ << ": " << f->foo << std::endl;
      }
      
      int main()
      {
          testFoobar();
          testFoobarAuto();
      
          return 0;
      }
      

      Find references for Foobar::foo doesn't present the results from testFoobarAuto() function.

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

            kosjar Nikolai Kosjar
            cadam Cristian Adam
            Votes:
            11 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes