2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x
|
2009-10-07 07:08:05 +08:00
|
|
|
|
|
|
|
struct A {};
|
|
|
|
|
|
|
|
struct B {
|
|
|
|
operator A*();
|
|
|
|
};
|
|
|
|
|
|
|
|
struct C : B {
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void foo(C c, B b, int A::* pmf) {
|
2009-10-08 01:26:09 +08:00
|
|
|
int j = c->*pmf;
|
2009-10-07 07:08:05 +08:00
|
|
|
int i = b->*pmf;
|
|
|
|
}
|
|
|
|
|
2009-10-16 01:14:05 +08:00
|
|
|
struct D {
|
|
|
|
operator const D *();
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DPtr {
|
|
|
|
operator volatile int D::*();
|
|
|
|
};
|
|
|
|
|
|
|
|
int test(D d, DPtr dptr) {
|
|
|
|
return d->*dptr;
|
|
|
|
}
|
|
|
|
|