Fariborz Jahanian | 4657a99 | 2009-10-06 23:08:05 +0000 | [diff] [blame^] | 1 | // RUN: clang-cc -fsyntax-only -verify %s -std=c++0x |
| 2 | |
| 3 | struct A {}; |
| 4 | |
| 5 | struct B { |
| 6 | operator A*(); |
| 7 | }; |
| 8 | |
| 9 | struct C : B { |
| 10 | |
| 11 | }; |
| 12 | |
| 13 | |
| 14 | void foo(C c, B b, int A::* pmf) { |
| 15 | // FIXME. Bug or correct? gcc accepts it. It requires derived-to-base followed by user defined conversion to work. |
| 16 | int j = c->*pmf; // expected-error {{left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'struct C'}} |
| 17 | int i = b->*pmf; |
| 18 | } |
| 19 | |