* call.c (build_special_member_call): Set TARGET_EXPR_DIRECT_INIT_P.
From-SVN: r257757
2018-02-16 Jason Merrill <jason@redhat.com>
+ PR c++/83835 - C++17 error with constructor ctors.
+ * call.c (build_special_member_call): Set TARGET_EXPR_DIRECT_INIT_P.
+
PR c++/82664 - ICE with reference to function template parm.
* pt.c (convert_nontype_argument_function): Avoid obfuscationg
NOP_EXPRs.
{
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);
--- /dev/null
+// 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 ) {}
+};