@@ -8834,6 +8834,9 @@ build_special_member_call (tree instance, tree name, vec<tree, va_gc> **args,
{
if (is_dummy_object (instance))
return arg;
+ else if (TREE_CODE (arg) == TARGET_EXPR)
+ TARGET_EXPR_DIRECT_INIT_P (arg) = true;
+
if ((complain & tf_error)
&& (flags & LOOKUP_DELEGATING_CONS))
check_self_delegation (arg);
new file mode 100644
@@ -0,0 +1,15 @@
+// PR c++/83835
+// { dg-do compile { target c++11 } }
+
+struct Z
+{
+ void const * p_;
+ constexpr Z( void const * p ): p_( p ) {}
+ ~Z();
+};
+
+struct Y
+{
+ Z z_;
+ constexpr Y() noexcept: z_( this ) {}
+};