[PATCH] D57058: Implement LWG3101 - span's Container constructors need another constraint
Louis Dionne via Phabricator
reviews at reviews.llvm.org
Tue Jan 22 12:01:54 PST 2019
ldionne added a comment.
This LGTM but I'd like to understand the situation I commented on with the rvalue before we commit this.
================
Comment at: test/std/containers/views/span.cons/container.fail.cpp:72
{
std::span<int> s1{IsAContainer<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
std::span<int> s3{NotAContainerNoData<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
----------------
mclow.lists wrote:
> ldionne wrote:
> > Why does this fail? Shouldn't this use `std::span<int, std::dynamic_extent>::span(Container const&)`?
> Because it's an rvalue? Dunno; but if so, that makes all the other tests useless. I will investigate.
>
I think it should compile because the `Container const&` will bind to a rvalue (and then the `std::span` contains a dangling reference).
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57058/new/
https://reviews.llvm.org/D57058
More information about the libcxx-commits
mailing list