2011-10-14 06:29:44 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
|
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 *'}} \
|
2019-10-24 08:54:10 +08:00
|
|
|
// expected-note 2 {{built-in candidate operator}}
|
2009-10-08 04:43:36 +08:00
|
|
|
}
|