Skip to content

winrt headers no longer compile after upgrading to g++ 15 #24209

Open
@CarterLi

Description

@CarterLi

Description / Steps to reproduce the issue

zhang@MSIGE76 ~> cat winrt.cpp
#include <winrt/Windows.Foundation.h>
zhang@MSIGE76 ~> g++ winrt.cpp -std=c++20
In file included from winrt.cpp:1:
C:/msys64/ucrt64/include/winrt/Windows.Foundation.h: In member function 'winrt::Windows::Foundation::IAsyncAction winrt::deferrable_event_args<D>::wait_for_deferrals()':
C:/msys64/ucrt64/include/winrt/Windows.Foundation.h:3313:43: error: non-template type 'coroutine_handle' used as a template [-Wtemplate-body]
 3313 |             co_await awaitable{ {}, *this };
      |                                           ^
C:/msys64/ucrt64/include/winrt/Windows.Foundation.h:3313:13: error: cannot instantiate a 'coroutine handle' for promise type 'voi' [-Wtemplate-body]
 3313 |             co_await awaitable{ {}, *this };
      |             ^~~~~~~~
zhang@MSIGE76 ~ [1]> g++ --version
g++.exe (Rev2, Built by MSYS2 project) 15.1.0
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

zhang@MSIGE76 ~> which g++
/ucrt64/bin/g++

Expected behavior

It compiles successfully

Actual behavior

Errored out

Verification

Windows Version

MINGW64_NT-10.0-26120

MINGW environments affected

  • MINGW64
  • MINGW32
  • UCRT64
  • CLANG64
  • CLANGARM64

Are you willing to submit a PR?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    GCCbugreported-upstreamIssues reported or fixed in upstream repository

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions