Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Coroutines: error when non-copyable/non-movable returned from `await_resume`

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

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

評価

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

調査の方向性

まず、説明されている Windows MSVC IntelliSense 構成で、C++20 を使用して main.cpp の報告を再現します。await_resume がコピー不可の foo を返すときの co_await 式の診断を追跡します。IntelliSense がエラーの波線を表示せず、一覧にあるコンパイラーが引き続きコードを受け入れれば完了です。

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

説明

bug Language Service parser Visual Studio
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

主要言語
TypeScript
スター
6.2k
フォーク
1.7k
平均マージ
1日 4時間
マージ済み PR(30日)
58

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

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

はじめの一歩

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

microsoft/vscode-cpptools のほかの issue

microsoft/vscode-cpptools の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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