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

Autocompletion of nested structs/unions omits several fields

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • Qt Creator 2.8.0, Qt Creator 3.0.0
    • C/C++/Obj-C++ Support
    • None

      Given a type as follows:

      typedef union
      {
          int W;
          struct
          {
              short S1;
              short S2;
          };
      } Test;
      

      Creating a variable and accessing the fields as follows

      Test t;
      t.
      

      autocomplete only shows the entry W, even though typing S1 or S2 is valid code. See also screenshot.

      Types like these are very common in the supporting codebase of microcontrollers (in my case, ARM Cortex-M3) so changing the inner struct to something with a name is not desireable. See also the screenshot attached.

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

            kosjar Nikolai Kosjar
            derjan Jan Dohl
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes