1// { dg-do run } 2// PRMS Id: 6486 3// Make sure that no confused handling of COND_EXPRs and SAVE_EXPRs messes 4// with the number of calls to foo. 5 6int c; 7 8struct A { 9 void f () {} 10 virtual void g () {} 11}; 12 13A& foo () 14{ 15 static A a; 16 ++c; 17 return a; 18} 19 20int main () 21{ 22 void (A::*p)() = &A::f; 23 (foo ().*p)(); 24 p = &A::g; 25 (foo ().*p)(); 26 27 return 2 - c; 28} 29