PR libstdc++/87809 avoid invalid expressions in exception specifications
commit7f3172ac97b729379858738e577aad9942f538c4
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Oct 2018 14:49:43 +0000 (30 14:49 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Oct 2018 14:49:43 +0000 (30 14:49 +0000)
treed7ef8e75bc61515acd3feda3aad3d0beb6ae3d77
parent16cce9e37afa3ef5c99a29fd007a30af5dca67bd
PR libstdc++/87809 avoid invalid expressions in exception specifications

If the allocator isn't default constructible then checking if the
default constructor throws in an exception specification makes the
declaration invalid. Use the type trait instead.

PR libstdc++/87809
* include/bits/forward_list.h (_Fwd_list_impl::_Fwd_list_impl()): Use
trait in exception-specification instead of possibly invalid
expression.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl()):
Likewise.
* include/bits/stl_list.h (_List_impl::_List_impl()): Likewise.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl()): Likewise.
* testsuite/23_containers/forward_list/cons/87809.cc: New test.
* testsuite/23_containers/list/cons/87809.cc: New test.
* testsuite/23_containers/vector/bool/cons/87809.cc: New test.
* testsuite/23_containers/vector/cons/87809.cc: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@265626 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/forward_list.h
libstdc++-v3/include/bits/stl_bvector.h
libstdc++-v3/include/bits/stl_list.h
libstdc++-v3/include/bits/stl_vector.h
libstdc++-v3/testsuite/23_containers/forward_list/cons/87809.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/list/cons/87809.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/vector/bool/cons/87809.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/vector/cons/87809.cc [new file with mode: 0644]