libstdc++: span's deduction-guide for built-in arrays doesn't work (LWG 3369)
authorJonathan Wakely <jwakely@redhat.com>
Wed, 19 Feb 2020 14:41:46 +0000 (14:41 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 19 Feb 2020 15:28:33 +0000 (15:28 +0000)
commit66ae31eb308e5bc90ce6dfd0a67381a0929a6aa0
treeb33c676794c3d8adaac4007d12201db29a5b38f9
parent247f410b83797a1840573840cc2a539ef9d7f96b
libstdc++: span's deduction-guide for built-in arrays doesn't work (LWG 3369)

The 23_containers/span/deduction.cc test was already passing, but only
because I had previously implemented the original proposed resolution of
3255. As pointed out in 3255 that original P/R was incorrect because it
broke construction from array xvalues. This reverts the incorrect part
of 3255 (and adds tests for the case it broke), and implements the
resolution of 3369 instead.

* include/std/span (span(T (&)[N])): Use non-deduced context to
prevent first parameter from interfering with class template argument
deduction (LWG 3369).
* testsuite/23_containers/span/deduction.cc: Add missing 'const'.
* testsuite/23_containers/span/lwg3255.cc: Check for construction from
rvalues.
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/span
libstdc++-v3/testsuite/23_containers/span/deduction.cc
libstdc++-v3/testsuite/23_containers/span/lwg3255.cc