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

Find usages and autocomplete features don't work when used with anonymous structures

    XMLWordPrintable

Details

    Description

      1. Use last stable Qt Creator 3.6.1
      2. Сreate plain C application, which uses anonymous structure
      3. Here is code
      test.pro
      TEMPLATE = app
      CONFIG += console
      CONFIG -= app_bundle
      CONFIG -= qt
      QMAKE_CFLAGS += -std=gnu11 -fms-extensions
      
      SOURCES += \
         main.c
      
      HEADERS += \
        main.h
      
      main.h
      #ifndef MAIN_H
      #define MAIN_H
      
      #define TEST_SIZE 512
      
      typedef struct test
      {
        struct unnamed_test
        {
          int test_field;
        };
      
        char reserved[(int)(TEST_SIZE - sizeof(struct unnamed_test))];
      } test;
      
      #endif // MAIN_H
      
      main.c
      #include <stdio.h>
      #include "main.h"
      
      int main(int argc, char *argv[])
      {
         test t;
      
         t.test_field = 0xfeed4c0d;
      
         printf("test_field = %#x\n", t.test_field);
      
         return 0;
      }
      

      4. Find usages feature (Ctrl+Shift+U hotkey) doesn't shows that field test_field of structure unnamed_test is used in main.c file.
      5. Autocomplete don't work for structure test.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            cppdev cppdev cppdev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes