You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code is rejected by libc++ because the second iterator argument to vector(iterator, iterator) is not deduced (https://godbolt.org/z/q8f9Y7):
I stumbled on this in my own code when I noticed that a typo in the following code was being accepted:
std::vector<int> v(other.cbegin(), other.end()); // note .end(), not .cend()
Since the second argument is not deduced, and the first argument is a const iterator, the second argument is implicitly converted to a const iterator. This is a symptom of the same issue, though I think this particular case could arguably be considered a conforming extension.
The text was updated successfully, but these errors were encountered:
Rereading what I wrote, I think I was unclear, so I'd like to clarify. I believe the constructor call being rejected is the conformance bug. My mention of the .assign() call was just to show that similar arguments work when passed to a different entity. It is correct that the .assign() call is accepted as written.
However, this seems to have been fixed somewhere between Clang 15 and Clang 16: https://godbolt.org/z/5EWWconno. I'll make sure we have tests for this and I'll close.
Extended Description
The following code is rejected by libc++ because the second iterator argument to
vector(iterator, iterator)
is not deduced (https://godbolt.org/z/q8f9Y7):The following code, however, is accepted (https://godbolt.org/z/nM4Yh4):
I believe this to be a conformance bug.
I stumbled on this in my own code when I noticed that a typo in the following code was being accepted:
Since the second argument is not deduced, and the first argument is a const iterator, the second argument is implicitly converted to a const iterator. This is a symptom of the same issue, though I think this particular case could arguably be considered a conforming extension.
The text was updated successfully, but these errors were encountered: