https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86646
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mpolacek at gcc dot gnu.org --- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> --- We reject the code because defaultable_fn_check doesn't like the copy ctor: it asks copy_fn_p whether it is a copy ctor but it doesn't think so: 12997 else if (TYPE_REF_P (arg_type) 12998 && !TYPE_REF_IS_RVALUE (arg_type) 12999 && TYPE_MAIN_VARIANT (TREE_TYPE (arg_type)) == DECL_CONTEXT (d)) here both the main variant and the context are "struct Foo", but they compare unequal. Will poke some more at this.