gcc/testsuite/g++.dg/conversion/ref12.C
raw| 1 | // PR c++/113141 |
| 2 | |
| 3 | struct Matrix { }; |
| 4 | |
| 5 | struct TPoint3 { private: operator const Matrix(); }; |
| 6 | |
| 7 | void f(Matrix&); |
| 8 | |
| 9 | int main() { |
| 10 | TPoint3 X; |
| 11 | Matrix& m = (Matrix &)X; // { dg-warning "does not use" } |
| 12 | f((Matrix &)X); // { dg-warning "does not use" } |
| 13 | } |
| 14 | |
| 15 | struct A { private: operator const int&(); } a; |
| 16 | int &r = (int&)a; // { dg-warning "does not use" } |
| 17 | |
| 18 | struct B { B(int); }; |
| 19 | int i; |
| 20 | B &br = (B&)i; // { dg-warning "does not use" } |