Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

erroneous "set but not used" warnings with reference variables

オープン
#14,801 コメント 0 件 リアクション 1 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
cpp
領域
devtools

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

bug Language Service
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

主要言語
TypeScript
スター
6.2k
フォーク
1.7k
平均マージ
18時間 20分
マージ済み PR(30日)
51

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/vscode-cpptools のほかの issue

microsoft/vscode-cpptools の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。