Skip to content

STL.natvis: shared_ptr<void> outputs an error #2688

@skypjack

Description

@skypjack

Describe the bug

When inspecting an std::shared_ptr<void> in the debugger, it outputs an error. This is due to the following line in the natvis file:

<DisplayString IncludeView="ptr" Condition="_Ptr != 0">{*_Ptr}</DisplayString>

In particular, std::shared_ptr<void> matches the condition (_Ptr != 0) but still we can't dereference it (*_Ptr).
The error also is pretty clear about the reasons:

Natvis: C:<path>\stl.natvis(395,63): Error: expression must be a pointer to a complete object type
Error while evaluating '*_Ptr' in the context of type '.exe!std::shared_ptr'.

Command-line test case

N/A (that's a natvis issue).

Expected behavior

Inspecting an std::shared_ptr<void> doesn't output any errors.

STL version

VS Community 2022 v17.1.6

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixedSomething works now, yay!visualizerHow the VS debugger displays STL types

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions