[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / builtin-ptrtomember-overload-1.cpp
bloba717c283ab78a7fea7c06831097eed3e6b2c9992
1 // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
3 struct A {};
4 struct E {};
6 struct R {
7 operator A*();
8 operator E*(); // expected-note{{candidate function}}
9 };
12 struct S {
13 operator A*();
14 operator E*(); // expected-note{{candidate function}}
17 struct B : R {
18 operator A*();
21 struct C : B {
25 void foo(C c, int A::* pmf) {
26 int i = c->*pmf;
29 struct B1 : R, S {
30 operator A*();
33 struct C1 : B1 {
37 void foo1(C1 c1, int A::* pmf) {
38 int i = c1->*pmf;
39 c1->*pmf = 10;
42 void foo1(C1 c1, int E::* pmf) {
43 int i = c1->*pmf; // expected-error {{use of overloaded operator '->*' is ambiguous}} \
44 // expected-note {{because of ambiguity in conversion of 'C1' to 'E *'}} \
45 // expected-note 2 {{built-in candidate operator}}