vscode-cpptools
vscode-cpptools copied to clipboard
typeof incorrectly removes qualifiers in some situations (with C clang/gcc modes)
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
This issue does not occur when using an lvalue derived from a name instead of dereferencing a pointer, e.g.:
@Halalaluyafail3 It works for me with cygwin with c++23. Can you run C/C++: Log Diagnostics to see how IntelliSense is being configured? What gnu_version is reported?
@sean-mcmanus I guess I didn't make it clear enough, but this is specifically about C. The issue goes away if the file is C++. The compiler path is the same as yours but with gcc instead of g++, and searching for gnu_version I see --gnu_version=150001.
@Halalaluyafail3 I've reported a bug on our shared VS parser at https://developercommunity.visualstudio.com/t/C-IntelliSense-with-clanggcc-mode-incor/10906841 . The issue repros with C with clang/gcc modes (not with msvc mode or C++).