https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109945
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org Known to fail|4.1.2, 4.5.3, 4.7.4, 4.9.0 | --- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- The testcase is very related to the old PR and shows the issue manifests itself also for !TYPE_NEEDS_CONSTRUCTING types. I wonder whether we need a CTOR at all here to show the issue. I also wonder how we can query whether the type has a CTOR (as opposed to "needs" one). The function type is <function_type 0x7ffff6ff3bd0 type <record_type 0x7ffff6fdef18 Widget sizes-gimplified needs-constructing cxx-odr-p type_1 type_5 type_6 BLK size <integer_cst 0x7ffff6ff6048 constant 160> unit-size <integer_cst 0x7ffff6ff6060 constant 20> align:32 warn_if_not_align:0 symtab:0 alias-set 2 canonical-type 0x7ffff6fdef18 fields <function_decl 0x7ffff6ffd000 __dt type <method_type 0x7ffff6ff3f18> public abstract external autoinline decl_3 QI t.ii:1:8 align:16 warn_if_not_align:0 context <record_type 0x7ffff6fdef18 Widget> full-name "Widget::~Widget() noexcept (<uninstantiated>)" not-really-extern chain <function_decl 0x7ffff6ffd200 __dt_base >> context <translation_unit_decl 0x7ffff6e3f168 t.ii> full-name "struct Widget" needs-constructor X() X(constX&) this=(X&) n_parents=0 use_template=0 interface-unknown pointer_to_this <pointer_type 0x7ffff6ff30a8> reference_to_this <reference_type 0x7ffff6ff3930> chain <type_decl 0x7ffff6e64c78 Widget>> so the type has TYPE_NEEDS_CONSTRUCTING set but it isn't TREE_ADDRESSABLE.