2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.brendan / ptrmem2.C
blob36145cf017cfd8cf30caafb69c5ac77360d0bb20
1 // { dg-do assemble  }
2 // GROUPS passed pointers-to-members
3 struct C {
4   struct N {
5     int g1(int);
6     int g2(int);
7   };
9   typedef int (N::*pmfn)(int);
10   
11   int f1(int);
12   int f2(int);
15 int (C::*f)(int) = &C::f1;              
18    The compiler should not crash on the line below; this change fixes it:
19         * cp-tree.c (list_hash_lookup_or_cons): Make sure the type doesn't
20         have TYPE_PTRMEMFUNC_P set before we try to build its
21         CLASSTYPE_ID_AS_LIST.
24 C::pmfn h = &C::N::g1;                  
26 int (C::N::*g)(int) = &C::N::g2;