Commit b76f3abc by Jason Merrill Committed by Jason Merrill

PR c++/83835 - C++17 error with constructor ctors.

	* call.c (build_special_member_call): Set TARGET_EXPR_DIRECT_INIT_P.

From-SVN: r257757
parent f7f77b9d
2018-02-16 Jason Merrill <jason@redhat.com> 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. PR c++/82664 - ICE with reference to function template parm.
* pt.c (convert_nontype_argument_function): Avoid obfuscationg * pt.c (convert_nontype_argument_function): Avoid obfuscationg
NOP_EXPRs. NOP_EXPRs.
......
...@@ -8834,6 +8834,9 @@ build_special_member_call (tree instance, tree name, vec<tree, va_gc> **args, ...@@ -8834,6 +8834,9 @@ build_special_member_call (tree instance, tree name, vec<tree, va_gc> **args,
{ {
if (is_dummy_object (instance)) if (is_dummy_object (instance))
return arg; return arg;
else if (TREE_CODE (arg) == TARGET_EXPR)
TARGET_EXPR_DIRECT_INIT_P (arg) = true;
if ((complain & tf_error) if ((complain & tf_error)
&& (flags & LOOKUP_DELEGATING_CONS)) && (flags & LOOKUP_DELEGATING_CONS))
check_self_delegation (arg); check_self_delegation (arg);
......
// 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 ) {}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment