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

"Add Definition in MyMap.cpp" converts std::map<int,int>::key_type to std::map::key_type in definition of function

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • Qt Creator 3.0.0-rc1
    • C/C++/Obj-C++ Support
    • None
    • Ubuntu 13.10 x86_64

    Description

      I have a header file MyMap.h with this content:

      MyMap.h
      #ifndef MYMAP_H
      #define MYMAP_H
      #include <map>
      typedef std::map<int, int> MyMap;
      void AddIntToMap(const MyMap::key_type & k, const MyMap::mapped_type & v);
      #endif // MYMAP_H
      

      and an empty MyMap.cpp file:

      MyMap.cpp
      #include "MyMap.h"
      

      When I move my cursor after the closing brace of AddIntToMap(...), press <ALT>+<Enter> and select "Add Definition in MyMap.cpp" I get this in MyMap.cpp:

      MyMap.cpp
      #include "MyMap.h"
      void AddIntToMap(const std::map::key_type & k, const std::map::mapped_type & v)
      {
          
      }
      

      I expected a definition of the AddIntToMap function that looks almost like the prototype in the header file but instead, the two parameters are typed std::map::key_type and std::map::value_type.

      Attachments

        Issue Links

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

          Activity

            People

              kosjar Nikolai Kosjar
              kkleine Konrad Kleine
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes