Unable to see wrapped by shared_ptr data

Answered

I cannot see data pointed in shared_ptr. It should be visible in watch window.

Screen from watch:

My configuration:

Clion 2017.1.1

Windows 8.1

I know tht Clion does not supprt MinGW in version 5.0, but I also installed 4.0 and there was the same problem.

Code:

int main() {
class Temp {
int data;
public:
Temp(int data) : data(data) {}
};

auto ptr = std::make_shared<Temp>(20);
std::cout << ptr;
return 0;
}
4
2 comments

I agree that for modern C++ code, this is an essential feature have. CLion is so much better than VS in many aspects but this aspect actually forces me to keep using VS.

0

Hi!

In case of LLDB the info about underlying object should be available.

In case of GDB there was an issue (https://youtrack.jetbrains.com/issue/CPP-2496) which should be fixed in the next CLion 2018.1 EAP. Please follow the updates in our blog. So please either consider upgrading CLion when 2018.1 is released or use a workaround suggested in the comment

0

Please sign in to leave a comment.