vscode-cpptools
vscode-cpptools copied to clipboard
constrained template friend incorrectly flagged as invalid
Environment
- OS and Version: Windows 10 22h2
- VS Code Version: 1.84.0
- C/C++ Extension Version: v1.18.0
Bug Summary and Steps to Reproduce
Bug Summary:
Steps to reproduce:
- Paste this code into a new project
#include<concepts>
#include<vector>
#include<memory>
class BaseNode{
int value;
template<std::derived_from<BaseNode> T>
friend class Database;
public:
virtual ~BaseNode(){}
};
template<std::derived_from<BaseNode> T>
class Database{
std::vector<std::unique_ptr<BaseNode>> nodes;
};
int main(){}
- See error
Expected behavior: No error, as compiling with g++ gives no errors.
Configuration and Logs
{
"configurations": [
{
"name": "windows-gcc-x64",
"includePath": [
"E:\\",
"E:\\include"
],
"compilerPath": "D:\\msys64\\mingw64\\bin\\g++.exe",
"cStandard": "c23",
"cppStandard": "c++23",
"intelliSenseMode": "windows-gcc-x64",
"compilerArgs": [
"-fno-ms-extensions"
]
}
],
"version": 4
}
Other Extensions
No response
Additional context
No response