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

REGRESSION: Locals and Expressions reports a structure containing a typedef'ed enum as inaccessible

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • Qt Creator 4.3.1
    • Qt Creator 4.3.0
    • Debugger
    • None
    • 82040140077723a5e09316e6f1595ccda27fc7c3

    Description

      Qt Creator 4.3.0 shows the following output in Locals and Expressions when inspecting a structure containing one structure consisting of a simple int and a second structure consisting of a typedef'ed enum:

      This is produced by the following code: 

       

      #include <QCoreApplication>
      
      typedef enum {
          SOME_ENUM_0 = 0,
          SOME_ENUM_1,
          SOME_ENUM_2,
          SOME_ENUM_3
      } TypedefEnum;
      
      struct StructWithTypdefEnum {
          TypedefEnum se = SOME_ENUM_0;
          std::string s = "This should also be accessible, but isn't!";
      };
      
      struct StructWithInt {
          int se = 0;
          std::string s = "This works!";
      };
      
      struct ShowBug {
          StructWithTypdefEnum inaccessible;
          StructWithInt accessible;
          std::string msg;
      };
      
      int main(void)
      {
          ShowBug test;
          test.msg = "Bug in QtCreator 4.3.0";
          return 0; // breakpoint here
      }

      Qt Creator up to 4.2.x treated this correctly and the bug was first introduced in 4.3.0. This is how Qt Creator 4.2.1 shows it (correctly) in Locals and Expressions:

       

       

      Attachments

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

        Activity

          People

            hjk hjk
            robschipper Rob
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes