FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.brendan / ptrmem2.C
blob2af19e04d84605c3fb4dca1ff3e983719e40984e
1 // Build don't link: 
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;