https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97268
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |WAITING Last reconfirmed| |2020-10-02 Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- GCC 10 says t.C: In instantiation of 'BetterObject<CACHED>::BetterObject(const char*, int, Handle&) [with bool CACHED = true]': t.C:61:31: required from here t.C:53:45: error: use of deleted function 'Handle::Handle(const Handle&)' 53 | , BetterObjectBase(lc_, ln_, env) {} | ^ t.C:9:5: note: declared here 9 | Handle(const Handle &) = delete; | ^~~~~~ and GCC 11 doesn't crash for me, but you didn't tell us the exact compile options or the target you are using. So GCC 11 accepts the testcase for me.