Public members of private base class show in autocomplete list
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- cpp, typescript, vscode
- Lĩnh vực
- devtools
Hướng nghiên cứu
Tái hiện vấn đề trong một tệp .cpp độc lập bằng cách sử dụng các lớp A và B được minh họa, sau đó lần theo điểm bắt đầu lọc thành viên của tính năng tự động hoàn thành trong extension C/C++. Bản sửa được hoàn tất khi các thành viên public được kế thừa thông qua một lớp cơ sở private bị loại bỏ bên ngoài lớp dẫn xuất, trong khi các thành viên có thể truy cập vẫn khả dụng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 6.2k
- Fork
- 1.7k
- Merge trung bình
- 14 giờ 46 phút
- Pull request đã merge (30 ngày)
- 61
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/vscode-cpptools
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
microsoft/vscode-cpptools#14787 ·
-
[Bug] cpptools fails to start on Ubuntu ARM64 due to missing execute permissions on shared libraries Đang mởbug fixed Language Service regression
microsoft/vscode-cpptools#14779 · 1 người được giao ·
-
Language Service more info needed
microsoft/vscode-cpptools#14778 · 1 bình luận · 1 người được giao ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 64/100
microsoft/vscode-cpptools#14769 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
microsoft/vscode-cpptools#14768 · 1 bình luận ·
Tất cả issue của microsoft/vscode-cpptools
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
area:tools bug good first issue help wanted priority:P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
TaewoooPark/Motifcode#14 ·
-
bug 🐞
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
BasedHardware/omi#15320 ·
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 78/100
vercel/vercel-plugin#199 ·