| 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 |
}; |
| 8 |
|
| 9 |
typedef int (N::*pmfn)(int); |
| 10 |
|
| 11 |
int f1(int); |
| 12 |
int f2(int); |
| 13 |
}; |
| 14 |
|
| 15 |
int (C::*f)(int) = &C::f1; |
| 16 |
|
| 17 |
/* |
| 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. |
| 22 |
*/ |
| 23 |
|
| 24 |
C::pmfn h = &C::N::g1; |
| 25 |
|
| 26 |
int (C::N::*g)(int) = &C::N::g2; |