summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.martin/eval1.C
blob: e3eb3d6bef640ad8295b42f6c5fa2390528cf940 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// { dg-do run  }
// Postfix expression must be evaluated even if accessing a static member.

struct S
{
	static int i;
	S* foo();
};

S* S::foo(){
  i = 0;
  return this;
}

int S::i = 1;
int main(void)
{
	S * s = new S;
	int k=(s->foo())->i;
	return k;
}