Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

erroneous "set but not used" warnings with reference variables

Aperta
#14,801 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp
Ambito
devtools

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
18h 16m
PR unite (30g)
51

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/vscode-cpptools

Tutte le issue di microsoft/vscode-cpptools

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.