1 // { dg-do assemble } 2 // GROUPS passed member-pointers error-reporting 3 struct Y 4 { 5 struct X 6 { 7 int A; fooY::X8 int Y::X::* foo () { undef1(1); return &Y::X::A; }// { dg-error "" } foo().* barY::X9 int bar () { return A; } 10 }; 11 }; 12 foo()13int Y::X::* foo () 14 { 15 undef2(1);// { dg-error "" } foo().* 16 return &Y::X::A; 17 } 18 foo2()19int Y::X::* (* foo2 ())() 20 { 21 undef3(1);// { dg-error "" } foo().* 22 return foo; 23 } 24 25 int (Y::X::* bar2 ()) () 26 { 27 undef4(1);// { dg-error "" } foo\(\).* 28 return Y::X::bar;// { dg-error "" } foo\(\).* 29 } 30 31 int Y::X::* (Y::X::* foo3 ())() 32 { 33 undef5(1);// { dg-error "" } foo().* 34 return Y::X::foo;// { dg-error "" } foo().* 35 } 36