-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++20 ranges support #900
C++20 ranges support #900
Conversation
Hmm, its not immediately obvious what those warnings are trying to tell us. 😜 |
Build is good, apart from the warnings. |
I reproduced the warning: it occurs when the function is used in unevaluated contexts, but never used outside of that, for example this code triggers it auto v = winrt::single_threaded_vector<int>();
decltype(v.begin()) a;
// uncomment to make warning disappear
// v.begin(); It's not specific to this change however, for example the following triggers the same warning: winrt::Windows::ApplicationModel::AppDisplayInfo a(nullptr);
decltype(a.Description()) b; Creating a auto v = winrt::single_threaded_vector<int>();
begin(v); The code above will trigger the warning
I don't think there's anything I can do to easily fix it :( Other than that, disabling the warning obviously works, as it's basically just noise (IMO it should be moved out of |
auto v = winrt::single_threaded_vector<int>();
begin(v); This sort of thing seems like a bug - if a test is doing this and causing a warning I'd be ok with fixing the test. |
I can't seem to find anywhere doing that. Darn unhelpful compiler diagnostics 😂 Going to see if Clang is any help |
This is really weird. I saw that (
This is very mysterious to me. I'm almost beginning to suspect a compiler regression? |
I wonder if it could be catch testing for member begin but then using ADL begin |
I tried building |
Found the issue! Line 2006 in 122b732
This silently started failing due to ambiguous overload errors (both The issue can be reproduced like this: void foo(winrt::Windows::Foundation::Collections::IVector<int> const& a)
{
using std::begin;
begin(a);
} I haven't found a workaround yet unfortunately. This probably needs some test coverage since |
Found a solution: piggybacking off Also added test coverage to avoid future breaks. I think this is ready for another internal build (and if everything's green, a merge) now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me - thanks!
2.0.210329.4 is the build that includes this feature. |
Follow-up to #873
Fixes #807
The regression was caused by me relying on some C++20 changes that automatically defined
pointer
tovoid
initerator_traits
if it wasn't defined by the iterator, while C++17 didn't define any member when that happened. Resolved by manually definingpointer
tovoid
(which is the most appropriate thing here, since WinRT iterators don't exposeoperator->
). With this change the whole test suite builds, runs, and passes.However, I am getting a lot of
'winrt::impl::consume_Windows_Foundation_Collections_IIterable<D,T>::begin': unreferenced local function has been removed
warnings when building, and I'm not sure where they come from, since the way this is implemented is 1:1 to things likewait_for
onIAsyncOperation
, and that function doesn't exhibit the issue. Any idea what causes this?