blob: e6165c0cce2af05886b75d0f7a7dcbbd7fe8e2d1 [file] [log] [blame]
Devang Patel704a5412010-05-10 17:49:40 +00001// RUN: %llvmgcc -S -O0 -g %s -o /dev/null
2// PR 7104
3
4struct A {
5 int Ai;
6};
7
8struct B : public A {};
9struct C : public B {};
10
11const char * f(int C::*){ return ""; }
12int f(int B::*) { return 1; }
13
14struct D : public C {};
15
16const char * g(int B::*){ return ""; }
17int g(int D::*) { return 1; }
18
19void test()
20{
21 int i = f(&A::Ai);
22
23 const char * str = g(&A::Ai);
24}
25
26// conversion of B::* to C::* is better than conversion of A::* to C::*
27typedef void (A::*pmfa)();
28typedef void (B::*pmfb)();
29typedef void (C::*pmfc)();
30
31struct X {
32 operator pmfa();
33 operator pmfb();
34};
35
36
37void g(pmfc);
38
39void test2(X x)
40{
41 g(x);
42}
43