https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83956
Bug ID: 83956 Summary: [8 regression] error: use of deleted function ‘{anonymous}::a::~a()’ Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: skpgkp1 at gmail dot com CC: hjl.tools at gmail dot com Target Milestone: --- This issue appear during HHVM build with GCC 8. GCC 7 works fine. $ cat foo.cpp.i namespace { struct a { ~a() = delete; }; struct b { ~b() {} union { a c; }; }; } $ g++ --version g++ (GCC) 8.0.1 20180120 (experimental) Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ g++ -O3 -o foo.cpp.o -c foo.cpp.i -w foo.cpp.i: In destructor ‘{anonymous}::b::~b()’: foo.cpp.i:6:8: error: use of deleted function ‘{anonymous}::a::~a()’ ~b() {} ^ foo.cpp.i:3:3: note: declared here ~a() = delete; ^ Work fine with GCC 7. $ g++ --version g++ (GCC) 7.2.1 20180120 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ g++ -O3 -o foo.cpp.o -c foo.cpp.i -w $ echo $? 0