Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

erroneous "set but not used" warnings with reference variables

Đang mở
#14,801 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp
Lĩnh vực
devtools

Hướng nghiên cứu

Reproduce the warning in a blank .cpp file using the reference-variable example, then inspect the linked diagnostic and language-server logs to locate the relevant analysis path. Done means the assignment through the reference is recognized as useful, with no set-but-unused warning or dimming.

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: Arch Linux (linux 7.2.6.arch2-1)
  • VS Code Version: 1.139.0 commit 2242ebbb54efeeb0129e08e919e7e8d43033cd83
  • C/C++ Extension Version: pre-release 1.35.2
  • If using SSH remote, specify OS of remote machine: N/A
Bug Summary and Steps to Reproduce

Bug Summary:

In the following code:

void modify(int& x){
    x = 3;
}

x is being erroneously marked as set-but-unused, even though the assignment can be useful.

Image

Steps to reproduce:

  1. Create a blank folder and a .cpp file with the content shown above in it
  2. Open the file
  3. See error

Expected behavior:
The variable is recognized as used and not dimmed, and there is no warning message on hover.

Configuration and Logs

c_cpp_properties.json: (none)

Log Diagnostics output

Language Server logging

Other Extensions

No response

Additional context

No response

Ngôn ngữ chính
TypeScript
Star
6.2k
Fork
1.7k
Merge trung bình
18 giờ 37 phút
Pull request đã merge (30 ngày)
50

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/vscode-cpptools

Tất cả issue của microsoft/vscode-cpptools

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.