gcc/testsuite/g++.dg/warn/Wunused-var-11.C
raw| 1 | // PR c++/44412 |
| 2 | // { dg-do compile } |
| 3 | // { dg-options "-Wunused" } |
| 4 | |
| 5 | struct S |
| 6 | { |
| 7 | int foo (); |
| 8 | static int bar (); |
| 9 | }; |
| 10 | |
| 11 | int S::foo () |
| 12 | { |
| 13 | return 5; |
| 14 | } |
| 15 | |
| 16 | int S::bar () |
| 17 | { |
| 18 | return 6; |
| 19 | } |
| 20 | |
| 21 | int |
| 22 | f1 () |
| 23 | { |
| 24 | S s; |
| 25 | return s.foo (); |
| 26 | } |
| 27 | |
| 28 | int |
| 29 | f2 () |
| 30 | { |
| 31 | S s; |
| 32 | return s.bar (); |
| 33 | } |