libstdc++: Correct noexcept-specifiers on span constructors
authorJonathan Wakely <jwakely@redhat.com>
Tue, 10 Dec 2019 23:50:26 +0000 (23:50 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 10 Dec 2019 23:50:26 +0000 (23:50 +0000)
commitcff87282f4f50c2fd471a2fe0df49312716a8caf
tree86eeb876af5718df8e8f38dd5347d6e2c594a446
parenta6ae300f9a019aff902cd11068af0956288d6541
libstdc++: Correct noexcept-specifiers on span constructors

As discussed at https://github.com/cplusplus/draft/issues/3534 two
std::span constructors specify incorrect conditions for throwing
exceptions. This patch makes those constructors have correct
noexcept-specifiers that accurately reflect what can actually throw.

(span(ContiguousIterator, Sentinel)): Add conditional noexcept.
* include/std/span (span(ContiguousIterator, size_type)): Change
noexcept to be unconditionally true.
* testsuite/23_containers/span/nothrow_cons.cc: New test.

From-SVN: r279206
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/span
libstdc++-v3/testsuite/23_containers/span/nothrow_cons.cc [new file with mode: 0644]