PR libstdc++/80553 don't allow destroying non-destructible types
authorJonathan Wakely <jwakely@redhat.com>
Fri, 28 Apr 2017 12:56:53 +0000 (13:56 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 28 Apr 2017 12:56:53 +0000 (13:56 +0100)
commitb26f45f0694604745bbb3d269cacecefd28b4faf
treee6ff20fa205ecfc3e0c7d6c978c8066aa11c02ff
parent38233afdcff80a2bb7ec7693f0d71497facbdd3b
PR libstdc++/80553 don't allow destroying non-destructible types

PR libstdc++/80553
* include/bits/stl_construct.h (_Destroy, _Destroy_n): Add static
assertions to ensure type is destructible.
(destroy_at, destroy, destroy_n): Move from stl_uninitialized.h.
* include/bits/stl_uninitialized.h (destroy_at, destroy, destroy_n):
Move to stl_construct.h.
* testsuite/20_util/specialized_algorithms/memory_management_tools/
destroy_neg.cc: New test.
* testsuite/23_containers/vector/cons/destructible_neg.cc: New test.

From-SVN: r247379
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_construct.h
libstdc++-v3/include/bits/stl_uninitialized.h
libstdc++-v3/testsuite/20_util/specialized_algorithms/memory_management_tools/destroy_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/vector/cons/destructible_neg.cc [new file with mode: 0644]