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) { |
Fariborz Jahanian | ca4fb04 | 2009-10-07 17:26:09 +0000 | [diff] [blame] | 15 | int j = c->*pmf; |
Fariborz Jahanian | 4657a99 | 2009-10-06 23:08:05 +0000 | [diff] [blame] | 16 | int i = b->*pmf; |
| 17 | } |
| 18 | |
Fariborz Jahanian | a9cca89 | 2009-10-15 17:14:05 +0000 | [diff] [blame] | 19 | struct D { |
| 20 | operator const D *(); |
| 21 | }; |
| 22 | |
| 23 | struct DPtr { |
| 24 | operator volatile int D::*(); |
| 25 | }; |
| 26 | |
| 27 | int test(D d, DPtr dptr) { |
| 28 | return d->*dptr; |
| 29 | } |
| 30 | |