gcc/testsuite/g++.dg/cpp0x/pr50025.C
raw| 1 | // { dg-do compile { target c++11 } } |
| 2 | |
| 3 | #include <utility> |
| 4 | |
| 5 | class A |
| 6 | { |
| 7 | public: |
| 8 | |
| 9 | A(int a, int& b, int&& c) |
| 10 | : m_a{a}, |
| 11 | m_b{b}, |
| 12 | m_c{std::move(c)} |
| 13 | {} |
| 14 | |
| 15 | private: |
| 16 | |
| 17 | int m_a; |
| 18 | int& m_b; |
| 19 | int&& m_c; |
| 20 | }; |
| 21 | |
| 22 | |
| 23 | struct X {}; |
| 24 | |
| 25 | class B |
| 26 | { |
| 27 | public: |
| 28 | |
| 29 | B(X& q, X&& r, const X& s) |
| 30 | : m_q{q}, |
| 31 | m_r{std::move(r)}, |
| 32 | m_s{s} |
| 33 | {} |
| 34 | |
| 35 | private: |
| 36 | |
| 37 | X& m_q; |
| 38 | X&& m_r; |
| 39 | const X& m_s; |
| 40 | }; |