1 // RUN: %clang_cc1 %s -emit-llvm -o %t
2
3 extern "C" int printf(...);
4
5 struct M {
MM6 M(int i){ iM = i; }
7 int iM;
MPRM8 void MPR() { printf("iM = %d\n", iM); }
9
10 };
11
12 struct Q {
QQ13 Q(int i){ iQ = i; }
14 int iQ;
QPRQ15 void QPR() { printf("iQ = %d\n", iQ); }
16 };
17
18 struct IQ {
IQIQ19 IQ(int i) { iIQ = i; }
IQPRIQ20 void IQPR() { printf("iIQ = %d\n", iIQ); }
21 int iIQ;
22 };
23
24 struct L : IQ {
LL25 L(int i) : IQ(i+100) { iL = i; }
26 int iL;
27 };
28
29 struct P : Q, L {
PP30 P(int i) : Q(i+100), L(i+200) { iP = i; }
31 int iP;
PPRP32 void PPR() { printf("iP = %d\n", iP); }
33 };
34
35
36 struct N : M,P {
NN37 N() : M(100), P(200) {}
PRN38 void PR() {
39 this->MPR(); this->PPR(); this->QPR();
40 IQPR();
41 printf("iM = %d\n", iM);
42 printf("iP = %d\n", iP);
43 printf("iQ = %d\n", iQ);
44 printf("iL = %d\n", iL);
45 printf("iIQ = %d\n", iIQ);
46 }
47 };
48
main()49 int main() {
50 N n1;
51 n1.PR();
52 }
53