microsoft / microsoft/vscode-cpptools

wrong type shown for reference captured by value.

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

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

bug Language Service Visual Studio
主要言語
TypeScript
スター
6.2k
フォーク
1.7k
平均マージ
14時間 46分
マージ済み PR(30日)
61

説明

Type: Bug

void Fun(const int& i) {
	std::cout << &i << '\n';
	[=]() {
		std::cout << &i << '\n';
	}();
}

hover over the i symbol inside the lambda.
the tooltip shows the type as const int &i. this is incorrect, the type should be const int i, the outer reference is captured by value.

Extension version: 1.11.5
VS Code version: Code 1.70.2 (e4503b30fc78200f846c62cf8091b76ff5547662, 2022-08-16T05:35:13.448Z)
OS version: Windows_NT x64 10.0.19044
Modes:
Remote OS version: Linux x64 5.10.102.1-microsoft-standard-WSL2
Remote OS version: Linux x64 5.10.102.1-microsoft-standard-WSL2

System Info
Item Value
CPUs Intel(R) Core(TM) i5-9400 CPU @ 2.90GHz (6 x 2904)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 47.66GB (16.61GB free)
Process Argv
Screen Reader no
VM 31%
Item Value
Remote WSL: CentOS7
OS Linux x64 5.10.102.1-microsoft-standard-WSL2
CPUs Intel(R) Core(TM) i5-9400 CPU @ 2.90GHz (6 x 2904)
Memory (System) 37.34GB (21.18GB free)
VM 0%
Item Value
Remote WSL: CentOS7
OS Linux x64 5.10.102.1-microsoft-standard-WSL2
CPUs Intel(R) Core(TM) i5-9400 CPU @ 2.90GHz (6 x 2904)
Memory (System) 37.34GB (21.18GB free)
VM 0%

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

まず、提供された C++ スニペットを Microsoft C/C++ extension で再現し、lambda 内の i にカーソルを合わせます。値でキャプチャされた参照に対する extension のホバー/型表示処理を追跡します。完了条件は、lambda の外部での正しい動作を維持しながら、tooltip に外側の参照を除いたキャプチャされた値の型が表示されることです。

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

評価

技術スタック
cpp
領域
devtools
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

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

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