microsoft / microsoft/vscode-cpptools

typeof incorrectly removes qualifiers in some situations (with C clang/gcc modes)

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

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

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

説明

Environment
  • OS and Version: Windows 10
  • VS Code Version: 1.100.2
  • C/C++ Extension Version: 1.25.3
Bug Summary and Steps to Reproduce

Bug Summary:

Steps to reproduce:
Use typeof with a qualified or atomic lvalue obtained from dereferencing a pointer to a qualified or atomic type, for example:

typedef typeof(*(const int*)0)x;

When hovering over this definition, it reports x as being the type int.

Expected behavior:
The reported type of x should be const int.

Configuration and Logs
{
	"configurations": [
		{
			"name": "Win32",
			"includePath": [
				"${workspaceFolder}/**"
			],
			"defines": [
				"_DEBUG",
				"UNICODE",
				"_UNICODE"
			],
			"cStandard": "c23",
			"cppStandard": "c++23",
			"intelliSenseMode": "linux-gcc-x64",
			"compilerPath": "C:/cygwin64/bin/gcc.exe"
		}
	],
	"version": 4
}
Other Extensions

No response

Additional context

Image

This issue does not occur when using an lvalue derived from a name instead of dereferencing a pointer, e.g.:

Image

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

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

はじめの一歩

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

調査の方向性

まず、報告された Windows GCC 構成で、提供された C23 typeof の例を使って hover の結果を再現し、次に、修飾型または atomic 型を指すポインターをデリファレンスした場合の IntelliSense の型情報を追跡します。完了条件は、提供された再現の場合も含め、報告される型が const または atomic の修飾子を保持することです。

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

評価

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

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

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