Commit 4757b071 by Jason Merrill Committed by Jason Merrill

* g++.dg/cpp0x/named.C: Test subobject of xvalue.

From-SVN: r175731
parent 97f309c3
2011-06-29 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/named.C: Test subobject of xvalue.
2011-06-30 Richard Guenther <rguenther@suse.de> 2011-06-30 Richard Guenther <rguenther@suse.de>
PR tree-optimization/46787 PR tree-optimization/46787
......
...@@ -13,6 +13,7 @@ struct T ...@@ -13,6 +13,7 @@ struct T
S && get() { return movel(s); } S && get() { return movel(s); }
operator S&&() { return movel(s); } operator S&&() { return movel(s); }
S && s; S && s;
S s2;
}; };
void named(S const &) {} void named(S const &) {}
...@@ -33,6 +34,7 @@ void f(S && p) ...@@ -33,6 +34,7 @@ void f(S && p)
unnamed(t.get()); // function return unnamed(t.get()); // function return
unnamed(t); // implicit conversion unnamed(t); // implicit conversion
unnamed(static_cast<S&&>(s)); // cast to rvalue unnamed(static_cast<S&&>(s)); // cast to rvalue
unnamed(static_cast<T&&>(t).s2); // cast to rvalue
} }
int main() int main()
......
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