Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp1z/eval-order9.C @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | |
children |
rev | line source |
---|---|
152 | 1 // { dg-do run } |
2 // { dg-additional-options -fstrong-eval-order=all } | |
3 | |
4 struct A | |
5 { | |
6 virtual A& operator=(const A&) { return *this; } | |
7 }; | |
8 | |
9 int i; | |
10 | |
11 A& f() { if (i != 1) __builtin_abort (); i = 2; static A a; return a; } | |
12 A& g() { if (i != 0) __builtin_abort (); i = 1; static A a; return a; } | |
13 | |
14 int main() | |
15 { | |
16 f() = g(); | |
17 if (i != 2) __builtin_abort (); | |
18 } |