blob: 32a893dafcef42688b92c788e4b31abf336279e2 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x
Fariborz Jahanianad3607d2009-10-09 17:09:58 +00002
3struct A {};
4
5struct R {
6 operator const A*();
7};
8
9
10struct B : R {
11 operator A*();
12};
13
14struct C : B {
15
16};
17
18
19void foo(C c, int A::* pmf) {
20 // FIXME. Why so many built-in candidates?
21 int i = c->*pmf; // expected-error {{use of overloaded operator '->*' is ambiguous}} \
Chris Lattner0c42bb62010-09-05 00:17:29 +000022 // expected-note {{built-in candidate operator->*(const struct A *, const int struct A::*)}} \
23 // expected-note {{built-in candidate operator->*(const struct A *, int struct A::*)}} \
Chris Lattner58f9e132010-09-05 00:04:01 +000024 // expected-note {{built-in candidate operator->*(struct A *, const int struct A::*)}} \
Fariborz Jahanian866b2742009-10-16 23:25:02 +000025 // expected-note {{built-in candidate operator->*(struct A *, int struct A::*)}}
Fariborz Jahanianad3607d2009-10-09 17:09:58 +000026}
27