Debug assist showing wrong datatip
Resharper C++ debug datatip seem to unable to recognize certain variables.
Here's some code I tape together to demonstrate the issue:
#pragma once
#include <unordered_map>
struct Data
{
std::unordered_map<int, int> _dataSet;
};
class Base
{
protected:
std::unordered_map<int, Data> _dataMap;
public:
Base() = default;
virtual ~Base() = default;
virtual void Test() = 0;
};
template<typename T>
class Derived : public Base
{
private:
int _testMemberVar = 0;
public:
static Derived* GetInstance()
{
static Derived instance;
return &instance;
}
void Test() override
{
_testMemberVar++; // Second issue
_dataMap[0]._dataSet[0] = 0; // First issue A
_dataMap[1]._dataSet[0] = 0;
_dataMap[2]._dataSet[0] = 0;
for (std::pair<const int, Data>& item : _dataMap)
{
item.second._dataSet[0] = 1; // First issue B
item.second._dataSet[1] = 2;
}
}
};
- The first issue occurred on the _dataMap[x]._dataSet[y] = z; (s) and item.second._dataSet[x] = y; (s)
Resharper saids: "::Base::_dataMap[0].::Data::_dataSet=expected an identifier" and "item.::std::pair<const int, Data>::second.::Data::_dataSet=expected an identifier" - The second issue occurred on _testMemberVar++;
Resharper saids: "::Derived<T>::_testMemberVar=identifier "Derived<T>" is undefined".
-The second issue does not go away even if I provide a template arg T for Resharper intelesense
-The second issue does go away if I change Derived into a non template class.
The default Visual Studio debug tip/watch has no issue giving me datatips and inspecting these variable. Im still trying out Resharper C++, I wonder if I did something wrong?
Build on x64
Visual Studio Version: 16.11.2
Resharper C++ Version: 2021.2.20210826.112918
Please sign in to leave a comment.
Hello,
Thanks for the report! This is a bug, I've filed https://youtrack.jetbrains.com/issue/RSCPP-32301 to track it.