gcc/testsuite/g++.dg/warn/deprecated-3.C
raw| 1 | /* PR 17947 bad warning with implicit conversion and __attribute__((deprecated)) */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "" } */ |
| 4 | |
| 5 | struct Foo |
| 6 | { |
| 7 | operator int() __attribute__((deprecated)); |
| 8 | }; |
| 9 | |
| 10 | void g(void) |
| 11 | { |
| 12 | Foo f; |
| 13 | (int)f; // { dg-warning "'Foo::operator int\\(\\)' is deprecated" } |
| 14 | } |