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

Find References broken with smart ptr in combination with type aliases

    XMLWordPrintable

Details

    • Linux/X11

    Description

      When I use `Find References` it works perfectly fine until there is a smart pointer and a type alias or typedef for the smart pointer.

      Using a type alias inside a smart pointer works perfectly fine.

      The use case for this is, when I have a pure abstract class which is passed around using a smart pointer I normally have a smart_ptr_typedefs.h with forward declarations and type aliases i.e.

      using UMyClass = std::unique_prt<MyClass>;

      using UConstMyClass = std::unique_prt<const MyClass>; 

       

      Having the type alias inside the class does solve the problem.

      The problem gets triggered by the class including the file where its type alias is defined.
      When the content of the included file is replaced with the include and the alias for that particular type is changed the problem vanishes.

      It seems as if ClangCodeModel does not respect header guards and runs in kind of a alias redefinition.

      When not using ClangCodeModel the problem still persists.

      Attachments

        1. nested-class.png
          nested-class.png
          94 kB
        2. not-working.png
          not-working.png
          63 kB
        3. working.png
          working.png
          62 kB

        Activity

          People

            Unassigned Unassigned
            patrickn Patrick Neulichedl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: