| 1 |
// PR c++/117259 |
| 2 |
// { dg-do compile } |
| 3 |
// { dg-options "-Wuninitialized -fsanitize=undefined" } |
| 4 |
|
| 5 |
struct A { void foo () {} }; |
| 6 |
struct B { void (A::*b) (); B (void (A::*x) ()) : b(x) {}; }; |
| 7 |
const B c[1] = { &A::foo }; |
| 8 |
|
| 9 |
void |
| 10 |
foo (A *x, int y) |
| 11 |
{ |
| 12 |
(x->*c[y].b) (); |
| 13 |
} |