// { dg-do run } // Copyright (C) 2003 Free Software Foundation, Inc. // Contributed by Nathan Sidwell 6 Sep 2003 // Origin: Volker Reichelt // PR c++/11788 we failed to instantiate a decl, and we lost some side // effects static int flag = 0; template struct A { A &active () { flag++;} static void foo() {} static void bar () {} static void bar (int) {} int m; }; void (*baz ()) () { A a; return &a.active ().foo; } void (*boz ()) () { A a; return &a.active ().bar; } int *buz () { A a; return &a.active ().m; } int main () { baz (); boz (); buz (); return flag != 3; }