https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110441
Matt Cross <matt.cross+gcc-bugzilla at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matt.cross+gcc-bugzilla@gma | |il.com --- Comment #5 from Matt Cross <matt.cross+gcc-bugzilla at gmail dot com> --- I have also found that * Making the function f() non-static works. https://godbolt.org/z/jn6Ms1n5h * Making a unique_ptr to an S fails: "auto sp = std::make_unique<S>(); return sp->f();" https://godbolt.org/z/85e9MW91b I suspect it is the same root cause, but just in case there's wrinkles here I thought these additional test cases might be helpful.