-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
Feature: Auto-completeLanguage ServiceWorks in VSSo we'd need to fix it for VS Code to reach parity.So we'd need to fix it for VS Code to reach parity.bug
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
.cpp
file 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
aandrejevas
Metadata
Metadata
Assignees
Labels
Feature: Auto-completeLanguage ServiceWorks in VSSo we'd need to fix it for VS Code to reach parity.So we'd need to fix it for VS Code to reach parity.bug
Type
Projects
Status
No status