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

QtCreator doesn't find usages for auto variables

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • 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)

    Description

      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.

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes