Commit 5e242863 by Jason Merrill Committed by Jason Merrill

re PR c++/46696 ([C++0x] Implicit copy constructor can't construct array of…

re PR c++/46696 ([C++0x] Implicit copy constructor can't construct array of subtype with user-defined copy constructor.)

	PR c++/46696
	* typeck.c (cp_build_modify_expr): Check DECL_DEFAULTED_FN.

From-SVN: r174226
parent 636e368d
2011-05-25 Jason Merrill <jason@redhat.com>
PR c++/46696
* typeck.c (cp_build_modify_expr): Check DECL_DEFAULTED_FN.
PR c++/47184
* parser.c (cp_parser_parameter_declaration): Recognize
list-initialization.
......
......@@ -6748,7 +6748,7 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs,
/* Allow array assignment in compiler-generated code. */
else if (!current_function_decl
|| !DECL_ARTIFICIAL (current_function_decl))
|| !DECL_DEFAULTED_FN (current_function_decl))
{
/* This routine is used for both initialization and assignment.
Make sure the diagnostic message differentiates the context. */
......
2011-05-25 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/defaulted29.C: New.
* g++.dg/cpp0x/initlist51.C: New.
2011-05-25 Janis Johnson <janisjo@codesourcery.com>
......
// PR c++/46696
// { dg-options -std=c++0x }
struct A
{
A& operator= (A const&);
};
struct B
{
A ar[1];
B& operator= (B const&) = default;
};
int main()
{
B x;
B y;
y = x;
}
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