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

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

    XMLWordPrintable

Details

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

    Description

      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)

      Attachments

        1. map with pairs.png
          49 kB
          Aaron Barany
        For Gerrit Dashboard: QTCREATORBUG-25251
        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes