Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / g++.dg / overload / addr1.C
blob25856a20fc62382eb65d27b15897460e2548d68b
1 // { dg-do run }
3 // Copyright (C) 2003 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 6 Sep 2003 <nathan@codesourcery.com>
5 // Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
7 // PR c++/11788 we failed to instantiate a decl, and we lost some side
8 // effects
10 static int flag = 0;
12 template <typename> struct A
14   A &active ()  { flag++;}
15   
16   static void foo() {}
18   static void bar () {}
19   static void bar (int) {}
21   int m;
24 void (*baz ()) ()
26     A<int> a;
27     return &a.active ().foo;
30 void (*boz ()) ()
32     A<int> a;
33     return &a.active ().bar;
36 int *buz ()
38   A<int> a;
39   
40   return &a.active ().m;
43 int main ()
45   baz ();
46   boz ();
47   buz ();
48   
49   return flag != 3;