Projet_SETI_RISC-V/riscv-gnu-toolchain/gcc/gcc/testsuite/g++.old-deja/g++.martin/eval1.C
2023-03-06 14:48:14 +01:00

22 lines
257 B
C

// { 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;
}