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

References to template arguments of global functions doesn't always work

    XMLWordPrintable

Details

    • 783ec18424289301bdf598e9a19dfb55f0847be9

    Description

      Consider the following code

      template<typename T>
      T* smart() { return 0; }
      
      struct A
      {
          int a;
      };
      
      void foo()
      {
          smart<A>()->a;
          A* ai = smart<A>();
          (void)ai->a;
      }
      

      Creator doesn't realize in the first statement in foo() that the the lower case "a" is a reference to the a member in the A class. If you take a copy of the A pointer returned then it does figure it out though as seen in the second and third statement.

      Attachments

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

        Activity

          People

            erikv Erik Verbruggen
            jhanssen Jan Erik Hanssen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes