[Bug libstdc++/80553] std::vector allows instantiation with type having a deleted destructor

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Apr 28 11:27:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80553

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
All standard library requirements produce undefined behaviour when violated,
unless specified otherwise. I'm trying to fix that: https://wg21.link/p0411r0

It probably won't be possible to enforce the "T is Erasable from X" requirement
for some containers, because C++17 allows std::vector<IncompleteType> to be
instantiated, and so we can't test for a usable destructor. The requirement
might have to be moved to the container's destructor to be enforceable as a
compile-time error.


More information about the Gcc-bugs mailing list