https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100252
--- Comment #10 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Proof of concept: --- a/gcc/cp/semantics.cc +++ b/gcc/cp/semantics.cc @@ -3296,6 +3296,14 @@ finish_compound_literal (tree type, tree compound_literal, if (TREE_CODE (compound_literal) == CONSTRUCTOR) TREE_HAS_CONSTRUCTOR (compound_literal) = false; compound_literal = get_target_expr_sfinae (compound_literal, complain); + if (parsing_nsdmi ()) + { + tree obj = TARGET_EXPR_SLOT (compound_literal); + tree &ctor = TARGET_EXPR_INITIAL (compound_literal); + replace_placeholders (compound_literal, obj); + if (TREE_CODE (ctor) == CONSTRUCTOR) + CONSTRUCTOR_PLACEHOLDER_BOUNDARY (ctor) = false; + } } else /* For e.g. int{42} just make sure it's a prvalue. */