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

Variable name not displayed for std::pair member variables.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Not Evaluated Not Evaluated
    • None
    • Qt Creator 4.14.0
    • Debugger
    • None

      When an std::pair is used as a member variable, it displays the first value in the pair for the name rather than the variable name. For example:

      struct MyStruct
      {
          std::pair<int, std::string> myPair;
      }
      
      MyStruct myStruct;
      myStruct.myPair = {3, "foo"};
      

      In this case, the debugger would show the following once you expand all the members:

      -> myStruct
          -> 3         "foo"
              first    3
              second   "foo"
      

      I would expect it to instead show something like:

      -> myStruct
          -> myPair    3, "foo"
              first    3
              second   "foo"
      

      Alternatively, it could just show the address for the variable to the right of the name and only the values once you expand it. (which is consistent with other types)

        1. map with pairs.png
          49 kB
          Aaron Barany
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            hjk hjk
            akb825 Aaron Barany
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes