Commit d8af1a55 by Jason Merrill Committed by Jason Merrill

re PR c++/56285 ([C++11] Arguments to an inheriting constructor are not forwarded properly)

	PR c++/56285
	* method.c (add_one_base_init): Handle base constructor
	taking rvalue reference parm.

From-SVN: r195990
parent 2ee028f1
2013-02-12 Jason Merrill <jason@redhat.com> 2013-02-12 Jason Merrill <jason@redhat.com>
PR c++/56285
* method.c (add_one_base_init): Handle base constructor
taking rvalue reference parm.
PR c++/56291 PR c++/56291
* semantics.c (sort_constexpr_mem_initializers): Handle * semantics.c (sort_constexpr_mem_initializers): Handle
vptr out of order. vptr out of order.
......
...@@ -500,7 +500,8 @@ add_one_base_init (tree binfo, tree parm, bool move_p, tree inh, ...@@ -500,7 +500,8 @@ add_one_base_init (tree binfo, tree parm, bool move_p, tree inh,
for (; parm; parm = DECL_CHAIN (parm)) for (; parm; parm = DECL_CHAIN (parm))
{ {
tree exp = convert_from_reference (parm); tree exp = convert_from_reference (parm);
if (TREE_CODE (TREE_TYPE (parm)) != REFERENCE_TYPE) if (TREE_CODE (TREE_TYPE (parm)) != REFERENCE_TYPE
|| TYPE_REF_IS_RVALUE (TREE_TYPE (parm)))
exp = move (exp); exp = move (exp);
*p = build_tree_list (NULL_TREE, exp); *p = build_tree_list (NULL_TREE, exp);
p = &TREE_CHAIN (*p); p = &TREE_CHAIN (*p);
......
// PR c++/56285
// { dg-options -std=c++11 }
struct foo {
explicit foo(int&&) {}
};
struct bar: private foo {
using foo::foo;
};
int main()
{
bar b { 42 };
}
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