Public members of private base class show in autocomplete list
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- cpp, typescript, vscode
- Domain
- devtools
Research direction
Reproduce the issue in a standalone .cpp file using the A and B classes shown, then trace the autocomplete member-filtering entry point in the C/C++ extension. The fix is done when public members inherited through a private base class are omitted outside the derived class, while accessible members remain available.
Written by the indexing model from the issue text.
Description
Environment
- OS and Version: Windows 10 Pro, 22H2, 19045.5371
- VS Code Version: 1.96.4 (user setup)
- C/C++ Extension Version: 1.23.5
- If using SSH remote, specify OS of remote machine: No SSH
Bug Summary and Steps to Reproduce
Bug Summary:
When the autocomplete list for members of a class shows while typing, public members (fields, methods, enums, etc.) from private base classes will show in the list as if the the base class was public, despite them being inaccessible outside of the derived class.
Steps to reproduce:
- Create a standalone
.cppfile without any extension or workplace-specific settings. - Create a class that privately inherits from a base class.
- In a function (not a method of the derived class) with a local variable of this derived class, open the autocomplete list by typing
.after the name. - Public members of base class will show in the list, even though it is private.
class A {
public:
int value;
};
class B : private A {};
void foo() {
B b;
// Typing here: `value` member is visible in list that pops up.
b.
}
Expected behavior:
Public members of a private base class should not appear in the autocomplete list in a scope where they can't be used, just like how is done with normal private/protected members.
Configuration and Logs
"C_Cpp.autoAddFileAssociations": false,
Other Extensions
Issue persists after disabling all other extensions and reloading window.
- Bookmarks
- C/C++ Extension Pack
- C/C++ (this extension)
- C/C++ Themes
- CMake
- CMake Tools
- Dev Containers
- Diff
- Docker
- Git History
- Python
- WSL
Additional context
No response
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode-cpptools
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoft/vscode-cpptools#14787 ·
-
[Bug] cpptools fails to start on Ubuntu ARM64 due to missing execute permissions on shared libraries Openbug fixed Language Service regression
microsoft/vscode-cpptools#14779 · 1 assignee ·
-
Language Service more info needed
microsoft/vscode-cpptools#14778 · 1 comment · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 64/100
microsoft/vscode-cpptools#14769 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
microsoft/vscode-cpptools#14768 · 1 comment ·
All issues in microsoft/vscode-cpptools
Similar issues
-
comp/dashboard P3 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
NousResearch/hermes-agent#117722 ·
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·