2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x
|
2009-10-08 04:43:36 +08:00
|
|
|
|
|
|
|
struct A {};
|
|
|
|
struct E {};
|
|
|
|
|
|
|
|
struct R {
|
|
|
|
operator A*();
|
2009-10-13 01:51:19 +08:00
|
|
|
operator E*(); // expected-note{{candidate function}}
|
2009-10-08 04:43:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct S {
|
|
|
|
operator A*();
|
2009-10-13 01:51:19 +08:00
|
|
|
operator E*(); // expected-note{{candidate function}}
|
2009-10-08 04:43:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct B : R {
|
|
|
|
operator A*();
|
|
|
|
};
|
|
|
|
|
|
|
|
struct C : B {
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
void foo(C c, int A::* pmf) {
|
|
|
|
int i = c->*pmf;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct B1 : R, S {
|
|
|
|
operator A*();
|
|
|
|
};
|
|
|
|
|
|
|
|
struct C1 : B1 {
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
void foo1(C1 c1, int A::* pmf) {
|
|
|
|
int i = c1->*pmf;
|
2009-10-09 02:00:39 +08:00
|
|
|
c1->*pmf = 10;
|
2009-10-08 04:43:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void foo1(C1 c1, int E::* pmf) {
|
2010-01-12 08:44:57 +08:00
|
|
|
int i = c1->*pmf; // expected-error {{use of overloaded operator '->*' is ambiguous}} \
|
2010-03-10 19:27:22 +08:00
|
|
|
// expected-note {{because of ambiguity in conversion of 'C1' to 'E *'}} \
|
2010-01-12 08:44:57 +08:00
|
|
|
// expected-note 4 {{built-in candidate operator}}
|
2009-10-08 04:43:36 +08:00
|
|
|
}
|