-
Notifications
You must be signed in to change notification settings - Fork 264
Closed
Description
I have an issue with C++/WinRT v2.0.191111.2 on a minimalistic sample.
clang-check is useful to get more warnings in C++.
My C++ test file minimal.cpp:
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Web.Syndication.h>
#include <iostream>
using namespace winrt;
using namespace Windows::Foundation;
using namespace Windows::Web::Syndication;
int main()
{
winrt::init_apartment();
Uri rssFeedUri{ L"https://blogs.windows.com/feed" };
SyndicationClient syndicationClient;
SyndicationFeed syndicationFeed = syndicationClient.RetrieveFeedAsync(rssFeedUri).get();
for (const SyndicationItem syndicationItem : syndicationFeed.Items())
{
winrt::hstring titleAsHstring = syndicationItem.Title().Text();
std::wcout << titleAsHstring.c_str() << std::endl;
}
}The commands used:
cppwinrt -i 10.0.18362.0 -verbose -out generated\
clang-check minimal.cpp -- --driver-mode=cl -m64 /std:c++17 /EHsc -Xclang -fcoroutines-ts -Xclang -isystem"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" -Xclang -isystem"C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" -Xclang -isystem".\generated"The previous commands work and behave correctly.
However when I try to replace -m64 with -m32 parameter, I get the following errors:
In file included from .\generated\winrt/Windows.Foundation.Collections.h:5:
.\generated\winrt/base.h(7607,14): error: no matching function for call to 'WINRT_TrySubmitThreadpoolCallback'
if (!WINRT_TrySubmitThreadpoolCallback(callback, handle.address(), nullptr))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\generated\winrt/base.h(412,24): note: candidate function not viable: no known conversion from '(lambda at .\generated\winrt/base.h:7602:25)' to
'void (*)(void *, void *) __attribute__((stdcall))' for 1st argument
int32_t __stdcall WINRT_TrySubmitThreadpoolCallback(void(__stdcall *callback)(void*, void* context), void* context, void*) noexcept;
^
.\generated\winrt/base.h(7638,56): error: no viable conversion from '(lambda at .\generated\winrt/base.h:7632:29)' to 'int32_t
(*)(winrt::impl::com_callback_args *) __attribute__((stdcall))' (aka 'int (*)(winrt::impl::com_callback_args *) __attribute__((stdcall))')
check_hresult(sta_context->ContextCallback(callback, &args, guid_of<ICallbackWithNoReentrancyToApplicationSTA>(), 5, nullptr));
^~~~~~~~
.\generated\winrt/base.h(7632,29): note: candidate function
auto callback = [](com_callback_args* args) noexcept -> int32_t
^
.\generated\winrt/base.h(1809,70): note: passing argument to parameter 'callback' here
virtual int32_t __stdcall ContextCallback(int32_t(__stdcall* callback)(com_callback_args*), com_callback_args* args, guid const& iid, int met...
^
2 errors generated.
Metadata
Metadata
Assignees
Labels
No labels