-
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
<algorithm>
: unqualified calls to _Adl_verify_range
incorrectly cause instantiation
#1596
Comments
I think this is a duplicate of #140. |
I never really grogged how that magic works, but doesnt if so would we need to do something like template <class _Iter, class _Sentinel>
constexpr void _Adl_verify_range(const _Iter& _First, const _Sentinel& _Last) {
// check that [_First, _Last) forms an iterator range
if constexpr (is_pointer_v<_Iter> && is_pointer_v<_Sentinel>) {
_STL_VERIFY(_First <= _Last, "transposed pointer range");
} else if constexpr (_Range_verifiable_v<_Iter, _Sentinel>) {
_Verify_range(_First, _Last);
}
} |
It's certainly related; I should have linked #140 in my submission. We've moved a bit beyond the hypothetical of #140 now that there are libc++ tests that we will have to avoid running.
Yes. Any unqualified call (or operator use) with the
Yes, this seems necessary but I haven't given enough thought to determine if it's sufficient. |
<algorithm>
: unqualified calls to _Adl_verify_range
incorrectly cause instantiation
Our implementation rejects this well-formed program (derived from the libc++ test that fails because of this bug):
by trying to instantiate
wrapper<incomplete>
despite that such instantiation is not necessary. The unqualified call to_Adl_verify_range(_First, _Last)
(which appears in most algorithms,std::sort
is simply an exemplar) necessitates instantiation ofwrapper<incomplete>
when_First
has typewrapper<incomplete>**
.The problem runs deeper than simply
_STD
-qualifying_Adl_verify_range
:_Verify_range
should be avoided when the arguments are pointers.The text was updated successfully, but these errors were encountered: