Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.martin/eval1.C

raw
1 // { dg-do run }
2 // Postfix expression must be evaluated even if accessing a static member.
3
4 struct S
5 {
6 static int i;
7 S* foo();
8 };
9
10 S* S::foo(){
11 i = 0;
12 return this;
13 }
14
15 int S::i = 1;
16 int main(void)
17 {
18 S * s = new S;
19 int k=(s->foo())->i;
20 return k;
21 }