Debian Codegraph @

gcc/testsuite/g++.dg/cpp1z/eval-order5.C

raw
1 // PR c++/91974
2 // { dg-do run }
3 // { dg-options "-fstrong-eval-order" }
4
5 extern "C" void abort ();
6
7 bool ok = false;
8
9 void
10 foo (int x)
11 {
12 if (x != 0)
13 abort ();
14 ok = true;
15 }
16
17 void
18 bar (int)
19 {
20 abort ();
21 }
22
23 int
24 main ()
25 {
26 typedef void (*T) (int);
27 T fn = foo;
28 fn ((fn = bar, 0));
29 if (fn != bar || !ok)
30 abort ();
31 }