Coroutines: error when non-copyable/non-movable returned from `await_resume`
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện báo cáo trong main.cpp với C++20 và cấu hình Windows MSVC IntelliSense được mô tả. Theo dõi chẩn đoán tại biểu thức co_await khi await_resume trả về foo không thể sao chép; được xem là hoàn tất khi IntelliSense không báo dấu gạch chân lượn sóng lỗi nào trong khi các trình biên dịch được liệt kê vẫn tiếp tục chấp nhận mã.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Environment
- OS and Version: Windows 11 25H2
- VS Code Version: 1.110.0
- C/C++ Extension Version: 1.30.5
- If using SSH remote, specify OS of remote machine: None
When returning a non-copyable and non-movable value from await_resume of an awaiter, intellisense reports this error at the co_await point (using MSVC as compiler): function "foo::foo(foo &&)" cannot be referenced -- it is a deleted function.
Nevertheless, MSVC, GCC and Clang accept the code and the program behaves as expected.
Bug Summary and Steps to Reproduce
Bug Summary:
Steps to reproduce: Paste the following snippet:
#include <coroutine>
#include <exception>
struct fire_and_forget final
{
struct promise_type;
};
struct fire_and_forget::promise_type final
{
static constexpr fire_and_forget get_return_object() noexcept { return {}; }
static constexpr std::suspend_never initial_suspend() noexcept { return {}; }
static constexpr std::suspend_never final_suspend() noexcept { return {}; }
static constexpr void return_void() noexcept {}
inline static void unhandled_exception() noexcept { std::terminate(); }
};
struct foo final
{
foo() = default;
foo(foo const &) = delete;
foo &operator=(foo const &) = delete;
foo(foo &&) = delete;
foo &operator=(foo &&) = delete;
};
struct my_awaiter final
{
bool await_ready() { return false; }
void await_suspend(auto) {}
foo await_resume() { return foo{}; }
};
fire_and_forget test()
{
auto x = co_await my_awaiter{}; // error here
}
Expected behavior: No error squiggles
Configuration and Logs
// c_cpp_properties.json
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/src"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.26100.0",
"intelliSenseMode": "windows-msvc-x64"
}
],
"version": 4
}
C/C++: Log Diagnostics
-------- Diagnostics - 3/5/2026, 12:04:00 PM
Version: 1.30.5
Current Configuration:
{
"name": "Win32",
"includePath": [
"<User>/thing/cpp/entt_scheduler_demo/**",
"<User>/thing/cpp/entt_scheduler_demo/src"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.26100.0",
"intelliSenseMode": "windows-msvc-x64",
"compilerPathIsExplicit": true,
"cStandardIsExplicit": true,
"cppStandardIsExplicit": true,
"intelliSenseModeIsExplicit": true,
"recursiveIncludesReduceIsExplicit": false,
"recursiveIncludesPriorityIsExplicit": false,
"recursiveIncludesOrderIsExplicit": false,
"cStandard": "c17",
"cppStandard": "c++20",
"mergeConfigurations": false,
"recursiveIncludes": {},
"compilerPath": "${env:CXX}",
"browse": {
"limitSymbolsToIncludedHeaders": true
}
}
Modified Settings:
{
"C_Cpp.inlayHints.autoDeclarationTypes.enabled": true,
"C_Cpp.inlayHints.parameterNames.enabled": true,
"C_Cpp.autocompleteAddParentheses": true,
"C_Cpp.errorSquiggles": "enabled",
"C_Cpp.default.compilerPath": "${env:CXX}",
"C_Cpp.default.cStandard": "c17",
"C_Cpp.default.cppStandard": "c++20",
"C_Cpp.commentContinuationPatterns": [
"/*"
],
"C_Cpp.codeAnalysis.clangTidy.enabled": true,
"C_Cpp.codeAnalysis.clangTidy.args": [
"-isystem=CMakeLists.txt",
"*"
],
"C_Cpp.codeAnalysis.clangTidy.checks.disabled": [
"cppcoreguidelines-avoid-magic-numbers",
"cppcoreguidelines-avoid-c-arrays",
"fuchsia-default-arguments-calls",
"fuchsia-default-arguments-declarations",
"fuchsia-overloaded-operator",
"hicpp-avoid-c-arrays",
"llvm-include-order",
"llvm-header-guard",
"llvmlibc-*",
"modernize-avoid-c-arrays",
"readability-magic-numbers"
],
"C_Cpp.experimentalFeatures": "enabled"
}
Additional Tracked Settings:
{
"editorTabSize": 4,
"editorInsertSpaces": true,
"editorAutoClosingBrackets": "languageDefined",
"filesEncoding": "utf8",
"filesAssociations": {},
"filesExclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/.DS_Store": true,
"**/Thumbs.db": true
},
"filesAutoSaveAfterDelay": false,
"editorInlayHintsEnabled": true,
"editorParameterHintsEnabled": true,
"searchExclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/*.code-search": true
},
"workbenchSettingsEditor": "ui"
}
cpptools version (native): 1.30.5.0
Current database path: <User>\APPDATA\LOCAL\MICROSOFT\VSCODE-CPPTOOLS\8867B49488CF20A004321616C2AF107D\.BROWSE.VC.DB
Translation Unit Mappings:
[ <User>\thing\cpp\entt_scheduler_demo\main.cpp - source TU]:
Translation Unit Configurations:
[ <User>\thing\cpp\entt_scheduler_demo\main.cpp ]
Process ID: 25624
Memory Usage: 85 MB
Compiler Path: C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.50.35717\bin\Hostx64\x64\cl.exe
Include paths:
include: <User>\thing\cpp\entt_scheduler_demo\src
system include: C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.50.35717\include
system include: C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.50.35717\atlmfc\include
system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um
system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt
system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\shared
system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\winrt
system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\cppwinrt
Defines:
_DEBUG
UNICODE
_UNICODE
Standard Version: ms_c++20
IntelliSense Mode: windows-msvc-x64
Total Memory Usage: 85 MB
------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 5892
Other Extensions
No response
Additional context
No response
- Ngôn ngữ chính
- TypeScript
- Star
- 6.2k
- Fork
- 1.7k
- Merge trung bình
- 1 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 58
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/vscode-cpptools
-
bug Language Service regression
microsoft/vscode-cpptools#14795 · 1 bình luận · 1 người được giao ·
-
bug Language Service parser
microsoft/vscode-cpptools#14794 · 1 bình luận · 1 người được giao ·
-
more info needed
microsoft/vscode-cpptools#14793 · 2 bình luận · 1 người được giao ·
-
more info needed
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
microsoft/vscode-cpptools#14787 · 1 bình luận · 1 người được giao ·
-
[Bug] cpptools fails to start on Ubuntu ARM64 due to missing execute permissions on shared libraries Đang mởbug fixed Language Service regression
microsoft/vscode-cpptools#14779 · 1 bình luận · 1 người được giao ·
Tất cả issue của microsoft/vscode-cpptools
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
vercel-labs/just-bash#464 ·
-
looksLikeSlug() is ASCII-only, so non-Latin entity slugs (e.g. Korean) skip exact match and collapse Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
TanStack/tanstack.com#1293 ·