https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80553
Bug ID: 80553 Summary: std::vector allows instantiation with type having a deleted destructor Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: marco at italiancpp dot org Target Milestone: --- struct Foo { ~Foo() = delete; }; int main() { vector<Foo> v; } This compiles just fine, although it shouldn't because 'Foo' is not Erasable. Repro: https://wandbox.org/#wandbox-resultwindow-code-body-12 On the other hand, in the following code a compile error is legitimately thrown: struct Foo { private: ~Foo(); }; int main() { vector<Foo> v; } std::list does not exhibit the same behavior: struct Foo { ~Foo() = delete; }; int main() { list<Foo> v; } which just fails. I have not tried other containers.