Commit 1c79ebd5 by Jason Merrill Committed by Jason Merrill

re PR c++/58162 ([C++11] bogus error: use of deleted function 'constexpr A::A(const A&)')

	PR c++/58162
	* parser.c (cp_parser_late_parse_one_default_arg): Set
	TARGET_EXPR_DIRECT_INIT_P.

From-SVN: r204263
parent 83f31d8d
2013-10-31 Jason Merrill <jason@redhat.com>
PR c++/58162
* parser.c (cp_parser_late_parse_one_default_arg): Set
TARGET_EXPR_DIRECT_INIT_P.
* class.c (type_build_ctor_call): Return early in C++98 mode.
(type_build_dtor_call): Likewise.
......
......@@ -23212,6 +23212,9 @@ cp_parser_late_parse_one_default_arg (cp_parser *parser, tree decl,
&& CONSTRUCTOR_IS_DIRECT_INIT (parsed_arg))
flags = LOOKUP_NORMAL;
parsed_arg = digest_init_flags (TREE_TYPE (decl), parsed_arg, flags);
if (TREE_CODE (parsed_arg) == TARGET_EXPR)
/* This represents the whole initialization. */
TARGET_EXPR_DIRECT_INIT_P (parsed_arg) = true;
}
}
......
// PR c++/58162
// { dg-require-effective-target c++11 }
struct A {
A();
A(A&&);
};
struct B {
A const a = A();
};
B b;
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