Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / warn / Wself-move2.C
blob0c0e1b9d5f93247fd1338e0c52f80b2b8298ddb5
1 // PR c++/109396
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-Wall" }
5 // Define std::move.
6 namespace std {
7   template<typename _Tp>
8     struct remove_reference
9     { typedef _Tp   type; };
11   template<typename _Tp>
12     struct remove_reference<_Tp&>
13     { typedef _Tp   type; };
15   template<typename _Tp>
16     struct remove_reference<_Tp&&>
17     { typedef _Tp   type; };
19   template<typename _Tp>
20     constexpr typename std::remove_reference<_Tp>::type&&
21     move(_Tp&& __t) noexcept
22     { return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); }
24 struct A {
25     int i_;
27     A(int) : i_(i_) { } // { dg-warning "itself" }
28     A(int, int) : i_(this->i_) { } // { dg-warning "itself" }
31 struct B {
32     int i_;
34     B(int) : i_(std::move(i_)) { }  // { dg-warning "itself" }
35     B(int, int) : i_(std::move(this->i_)) { } // { dg-warning "itself" }