1// { dg-do run } 2// Origin: Mark Mitchell <mark@codesourcery.com> 3 4extern "C" void abort (); 5 6int count; 7 8struct S 9{ 10 S (); 11 S (const S&); 12 ~S (); 13 14 int i; 15}; 16 17S::S () 18{ 19 i = count++; 20} 21 22S::S (const S&) 23{ 24 i = count++; 25} 26 27S::~S () 28{ 29 if (--count != i) 30 abort (); 31} 32 33void f (S, S) 34{ 35} 36 37int main () 38{ 39 { 40 S s; 41 f (s, s); 42 } 43 return count != 0; 44} 45 46