microsoft / microsoft/vscode-cpptools

[cppvsdbg] "expression must have a pointer type" in the Watch window for types that implement operator->()

Open
#4,998 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug debugger
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

  1. Use the cppvsdbg debugger.
  2. Use object->val in the Watch window, where object is a type that implements operator->().

Bug: The Watch windows shows the error "expression must have a pointer type" instead of evaluating the operator->(), which returns a pointer type and then using that result to do the ->val to access the value.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in the cppvsdbg debugger's Watch window with an object->val expression where the object's type implements operator->(). Trace how the expression is evaluated; done means the operator->() result is recognized as a pointer and its val member can be accessed without the pointer-type error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.