-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
bugSomething isn't workingSomething isn't workingfixedSomething works now, yay!Something works now, yay!
Description
Our implementation rejects this well-formed program (derived from the libc++ test that fails because of this bug):
#include <algorithm>
#include <iterator>
struct incomplete;
template <class T>
struct wrapper {
T t;
};
int main() {
wrapper<incomplete>* some_pointers[42]{};
std::sort(std::begin(some_pointers), std::end(some_pointers));
}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 of wrapper<incomplete> when _First has type wrapper<incomplete>**.
The problem runs deeper than simply _STD-qualifying _Adl_verify_range:
- the machinery it uses presumably makes other unqualified calls that will need to be dealt with, and
- the unqualified call to
_Verify_rangeshould be avoided when the arguments are pointers.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixedSomething works now, yay!Something works now, yay!