[libc++] Fix the noexceptness of __decay_copy.
authorArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Mon, 13 Dec 2021 19:50:37 +0000 (14:50 -0500)
committerArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Mon, 13 Dec 2021 22:55:38 +0000 (17:55 -0500)
commit4dd901f4d3aa072309eb23fbd8497f7916f7d77c
tree831ae9dee5810d61a363ae7f8416e66bd04ec20d
parentaba437ceb2379f219935b98a10ca3c5081f0c8b7
[libc++] Fix the noexceptness of __decay_copy.

When `a` was an array type, `__decay_copy(a)` was incorrectly marking itself
noexcept(false), because it is false that `int[10]` is nothrow convertible to `int[10]`
(in fact it is not convertible at all).

We have no tests explicitly for `__decay_copy`, but the new ranges::begin
and ranges::end tests fail before this patch.

Differential Revision: https://reviews.llvm.org/D115658
libcxx/include/__utility/decay_copy.h
libcxx/test/std/ranges/range.access/range.access.begin/begin.pass.cpp
libcxx/test/std/ranges/range.access/range.access.end/end.pass.cpp