microsoft / microsoft/vscode-cpptools
False intellisense error with defaulted template parameter of `decltype(lambda)` in C++20/23
Open
Nobody has claimed this yet.
bug
Language Service
parser
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Environment
- OS and Version: Windows 11
- VS Code Version: 1.92.2
- C/C++ Extension Version: 1.21.6
- If using SSH remote, specify OS of remote machine: WSL2 Ubuntu 22.04
Bug Summary and Steps to Reproduce
Bug Summary:
False intellisense error for the following minimal snippet :
template <typename T = decltype([](int a, int b) {})>
struct S {
S(T t = {}) {}
};
void solve() {
S s; // no viable template argument deduction candidate found for class template "S"C/C++(3165)
}
Steps to reproduce:
- Paste the following snippet
- Set the C++ Standard to C++20/23 in "C/C++: Edit Configurations"
- See error
Expected behaviour:
Intellisense should not emit an error.
Configuration and Logs
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"LC_LOCAL"
],
"compilerPath": "/usr/bin/g++-13",
"cStandard": "c17",
"cppStandard": "c++20",
"intelliSenseMode": "linux-gcc-x64",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}
-------- Diagnostics - 8/19/2024, 9:48:10 AM
Version: 1.21.6
Current Configuration:
{
"name": "Linux",
"includePath": [
"/home/sames/proj/competitive-programming/**"
],
"defines": [
"LC_LOCAL"
],
"compilerPath": "/usr/bin/g++-13",
"cStandard": "c17",
"cppStandard": "c++20",
"intelliSenseMode": "linux-gcc-x64",
"configurationProvider": "ms-vscode.cmake-tools",
"compilerPathIsExplicit": true,
"cStandardIsExplicit": true,
"cppStandardIsExplicit": true,
"intelliSenseModeIsExplicit": true,
"compilerPathInCppPropertiesJson": "/usr/bin/g++-13",
"configurationProviderInCppPropertiesJson": "ms-vscode.cmake-tools",
"mergeConfigurations": false,
"browse": {
"path": [
"/home/sames/proj/competitive-programming/**",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true
}
}
cpptools version (native): 1.21.6.0
Translation Unit Mappings:
[ /home/sames/proj/competitive-programming/cp/F.cpp - source TU]:
Translation Unit Configurations:
[ /home/sames/proj/competitive-programming/cp/F.cpp ]:
Process ID: 3649
Memory Usage: 16 MB
Compiler Path: /usr/bin/g++-13
Includes:
System Includes:
/usr/include/c++/13
/usr/include/x86_64-linux-gnu/c++/13
/usr/include/c++/13/backward
/usr/lib/gcc/x86_64-linux-gnu/13/include
/usr/local/include
/usr/include/x86_64-linux-gnu
/usr/include
Defines:
LC_LOCAL
Standard Version: c++20
IntelliSense Mode: linux-gcc-x64
Other Flags:
--g++
--gnu_version=130100
Total Memory Usage: 16 MB
------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 3308
Other Extensions
No response
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the minimal template and lambda snippet in VS Code with the provided C++20 configuration, using g++-13 and the C/C++ extension. Trace the IntelliSense diagnostic for S s and verify that the false template argument deduction error disappears for C++20 and C++23 without affecting valid diagnostics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, vscode
- Domain
- compilers, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100