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

Code model confused by struct type alias in a namespace

    XMLWordPrintable

Details

    • Linux/X11

    Description

      When there is a using type alias for a struct inside a namespace, the code model gets confused and thinks that subsequent functions are in the namespace named as the alias:

      #include "myclass.h"
      
      namespace ns {
      
      using StructType = struct {
          int a;
          char b;
      };
      
      MyClass::MyClass()
      {
      }
      
      void MyClass::Function()
      {
      }
      
      } //ns
      

      This results in the following model:

      Consequently, this causes the Function() to be unreachable when ctrl+LMB cliked in the header.

      When I remove the using StructType it's ok again.

      Whole project attached.

      Attachments

        1. cppmodelbug.zip
          2 kB
          Miłosz Kosobucki
        2. image-2020-10-29-18-11-45-870.png
          13 kB
          Miłosz Kosobucki
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kandeler Christian Kandeler
            mikom Miłosz Kosobucki
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes