brintos

brintos / llvm-project-archived public Read only

0
0
Text · 850 B · a717c28 Raw
47 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++112 3struct A {};4struct E {};5 6struct R {7    operator A*();8    operator E*();	// expected-note{{candidate function}}9};10 11 12struct S {13    operator A*();14    operator E*();	// expected-note{{candidate function}}15};16 17struct B  : R {18    operator A*();19};20 21struct C : B {22 23};24 25void foo(C c, int A::* pmf) {26	int i = c->*pmf; 27}28 29struct B1  : R, S {30    operator A*();31};32 33struct C1 : B1 {34 35};36 37void foo1(C1 c1, int A::* pmf) {38        int i = c1->*pmf;39        c1->*pmf = 10;40}41 42void 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}}46}47