mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/56235 (Bogus "error: invalid conversion from ‘unsigned char’ to ‘B::Mode’ [-fpermissive]")
PR c++/56235 * method.c (do_build_copy_constructor): Don't bother turning scalars from lvalues to xvalues. (do_build_copy_assign): Likewise. From-SVN: r195854
This commit is contained in:
parent
54353978a4
commit
702f9fe535
|
|
@ -1,3 +1,10 @@
|
||||||
|
2013-02-07 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
PR c++/56235
|
||||||
|
* method.c (do_build_copy_constructor): Don't bother turning
|
||||||
|
scalars from lvalues to xvalues.
|
||||||
|
(do_build_copy_assign): Likewise.
|
||||||
|
|
||||||
2013-02-06 Jason Merrill <jason@redhat.com>
|
2013-02-06 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
* parser.c (cp_parser_enum_specifier): Check for error_mark_node.
|
* parser.c (cp_parser_enum_specifier): Check for error_mark_node.
|
||||||
|
|
|
||||||
|
|
@ -610,7 +610,9 @@ do_build_copy_constructor (tree fndecl)
|
||||||
}
|
}
|
||||||
|
|
||||||
init = build3 (COMPONENT_REF, expr_type, parm, field, NULL_TREE);
|
init = build3 (COMPONENT_REF, expr_type, parm, field, NULL_TREE);
|
||||||
if (move_p && TREE_CODE (expr_type) != REFERENCE_TYPE)
|
if (move_p && TREE_CODE (expr_type) != REFERENCE_TYPE
|
||||||
|
/* 'move' breaks bit-fields, and has no effect for scalars. */
|
||||||
|
&& !scalarish_type_p (expr_type))
|
||||||
init = move (init);
|
init = move (init);
|
||||||
init = build_tree_list (NULL_TREE, init);
|
init = build_tree_list (NULL_TREE, init);
|
||||||
|
|
||||||
|
|
@ -724,7 +726,9 @@ do_build_copy_assign (tree fndecl)
|
||||||
expr_type = cp_build_qualified_type (expr_type, quals);
|
expr_type = cp_build_qualified_type (expr_type, quals);
|
||||||
|
|
||||||
init = build3 (COMPONENT_REF, expr_type, init, field, NULL_TREE);
|
init = build3 (COMPONENT_REF, expr_type, init, field, NULL_TREE);
|
||||||
if (move_p && TREE_CODE (expr_type) != REFERENCE_TYPE)
|
if (move_p && TREE_CODE (expr_type) != REFERENCE_TYPE
|
||||||
|
/* 'move' breaks bit-fields, and has no effect for scalars. */
|
||||||
|
&& !scalarish_type_p (expr_type))
|
||||||
init = move (init);
|
init = move (init);
|
||||||
|
|
||||||
if (DECL_NAME (field))
|
if (DECL_NAME (field))
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
// PR c++/56235
|
||||||
|
|
||||||
|
struct A
|
||||||
|
{
|
||||||
|
A (const A &);
|
||||||
|
};
|
||||||
|
|
||||||
|
struct B
|
||||||
|
{
|
||||||
|
A a;
|
||||||
|
enum Mode { };
|
||||||
|
Mode m:8;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct C
|
||||||
|
{
|
||||||
|
C();
|
||||||
|
B b;
|
||||||
|
};
|
||||||
|
|
||||||
|
C fn()
|
||||||
|
{
|
||||||
|
return C();
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue