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
This commit is contained in:
Jason Merrill 2013-10-31 10:41:55 -04:00 committed by Jason Merrill
parent 83f31d8d5d
commit 1c79ebd522
3 changed files with 20 additions and 0 deletions

View File

@ -1,5 +1,9 @@
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.

View File

@ -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;
}
}

View File

@ -0,0 +1,13 @@
// PR c++/58162
// { dg-require-effective-target c++11 }
struct A {
A();
A(A&&);
};
struct B {
A const a = A();
};
B b;