https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66542
Bug ID: 66542 Summary: [C++11] Can create static variable of type that has deleted destructor Product: gcc Version: 5.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: fordeso2 at gmail dot com Target Milestone: --- Created attachment 35782 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35782&action=edit Preprocessed file with bug when a class has user-defined (not default) constructor and destructor marked deleted, gcc allows creating of a static variable of class's type. Command line: gcc -std=c++11 -lstdc++ ret.cpp Target: x86_64-unknown-linux-gnu Configured with: /build/gcc-multilib/src/gcc-5-20150519/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --with-default-libstdcxx-abi=c++98 Thread model: posix Attached preprocessed file.