I found 3 issues with "auto" keyword in C++ and auto-list feature in 23.0.1.2 using Visual Studio 2015 on Windows 7 x64. The issues reproduce with a clean config.
I DON'T have this issue in my Linux x64 with CentOS 7.2 and gcc 4.8.2, only with Visual Studio 2015/Windows x64.
I DO have this issue using a compiler tag file with cygwin gcc (directory C:\cygwin\lib\gcc\i686-pc-cygwin\7.3.0\include) instead of Visual Studio 2015.
I have attached a full Visual Studio 2015 solution.
Below is the code, search for "ISSUE" below to see where the 3 issues are.
#include <map>
#include <string>
#include <iostream>
class MyClass
{
public:
MyClass(int item1, int item2)
: item1_(item1),
item2_(item2)
{
}
int item1_;
int item2_;
};
int main(int argc, char* argv[])
{
// Tools->Tag files shows my tag file for Visual Studio 14.0 is selected and includes many files in the VC\include directory
// push-tag on std::map properly finds it in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\map
// push-tag on std::string properly finds it in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstring
// push-tag on MyClass properly finds it in this file
std::map<std::string, MyClass> myClassMap_;
std::string myString = "hi there";
myClassMap_.try_emplace(myString, 1, 2);
// myMapIt case 1: Use auto
auto myMapIt = myClassMap_.lower_bound(myString);
// myMapIt case 2: Declare the type
//std::map<std::string, MyClass>::iterator myMapIt = myClassMap_.lower_bound(myString);
// ISSUE #1:
// When I place the cursor to the right of the '>' in myMapIt->first, SE freezes for a second or 2
// After it unfreezes, if I use the scroll wheel to scroll, SE is also slow
//
// ISSUE #2:
// When I backspace the '>' below and type > again for autolist, I get no autolist showing "first" and "second"
// This happens for both "myMapIt case 1: Use auto" and for "myMapIt case 2: Declare the type"
auto itemKey = myMapIt->first;
auto itemValue = myMapIt->second;
std::cout << "itemKey: " << itemKey << "\n";
// ISSUE #3: When I type the "." after "itemValue" below, I don't get an autolist for "item1_" and "item2_"
std::cout << "itemValue.item1_: " << itemValue.item1_ << "\n";
}