-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
LWG-3850: views::as_const
on empty_view<T>
should return empty_view<const T>
#3423
Conversation
@@ -303,13 +340,16 @@ constexpr bool test_one(Rng&& rng, Expected&& expected) { | |||
{ | |||
const same_as<iterator_t<R>> auto i = r.begin(); | |||
if (!is_empty) { | |||
// (static analyzer doesn't realize that `i == nullptr` implies `is_empty`) | |||
#pragma warning(suppress : 6011) // Dereferencing NULL pointer 'i' |
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.
No change requested: We avoid suppress
in stl/inc
(as it sometimes has issues with templates and/or modules, whereas push/disable/pop
is reliable) but it's fine in stl/src
and test code.
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.
I was concerned about empty_view<int&>
being wrong, but it turns out that empty_view<reference-type>
is invalid.
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for helping the list of remaining LWG issues get closer to empty! 😹 📉 🎉 |
Closes #3418.