Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/warn/Wunused-var-10.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // PR c++/44412 |
2 // { dg-do compile } | |
3 // { dg-options "-Wunused" } | |
4 | |
5 struct S | |
6 { | |
7 static const int a = 3; | |
8 static int b; | |
9 int c; | |
10 }; | |
11 | |
12 const int S::a; | |
13 int S::b = 4; | |
14 | |
15 int | |
16 f1 () | |
17 { | |
18 S s; | |
19 return s.a; | |
20 } | |
21 | |
22 int | |
23 f2 () | |
24 { | |
25 S s; | |
26 return s.b; | |
27 } | |
28 | |
29 void | |
30 f3 () | |
31 { | |
32 S s; // { dg-warning "set but not used" } | |
33 s.c = 6; | |
34 } | |
35 | |
36 int | |
37 f4 () | |
38 { | |
39 S s; | |
40 s.c = 6; | |
41 return s.c; | |
42 } |