https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106812
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
The difference between #3 and not-#3 is that without the NSDMI, S isn't
TYPE_NEEDS_CONSTRUCTING, which makes a difference in initialize_handler_parm:
339 /* If the constructor for the catch parm exits via an exception, we
340 must call terminate. See eh23.C. */
341 if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl)))
342 {
343 /* Generate the copy constructor call directly so we can wrap it.
344 See also expand_default_init. */
345 init = ocp_convert (TREE_TYPE (decl), init,
346 CONV_IMPLICIT|CONV_FORCE_TEMP, 0,
347 tf_warning_or_error);