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 foo(int x)10foo (int x) 11 { 12 if (x != 0) 13 abort (); 14 ok = true; 15 } 16 17 void bar(int)18bar (int) 19 { 20 abort (); 21 } 22 23 int main()24main () 25 { 26 typedef void (*T) (int); 27 T fn = foo; 28 fn ((fn = bar, 0)); 29 if (fn != bar || !ok) 30 abort (); 31 } 32