1// RUN: %clang_cc1 %s -emit-llvm-only -triple=i386-pc-win32 -verify -DTEST1
2// RUN: %clang_cc1 %s -emit-llvm-only -triple=i386-pc-win32 -verify -DTEST2
3
4#ifdef TEST1
5struct A {
6  virtual A *foo();  // in vftable slot #0.
7  virtual A *bar();  // in vftable slot #1.
8};
9
10struct B : virtual A {
11  // appended to the A subobject's vftable in slot #2.
12  virtual B *foo(); // expected-note{{covariant thunk required by 'foo'}}
13};
14
15struct C : virtual A {
16  // appended to the A subobject's vftable in slot #2.
17  virtual C *bar(); // expected-note{{covariant thunk required by 'bar'}}
18};
19
20struct D : B, C { D(); }; // expected-error{{ambiguous vftable component}}
21D::D() {}
22#endif
23
24#ifdef TEST2
25struct A {
26  virtual A *foo(); // in vftable slot #0
27};
28
29struct B : virtual A {
30  // appended to the A subobject's vftable in slot #1.
31  virtual B *foo(); // expected-note{{covariant thunk required by 'foo'}}
32};
33
34struct C : virtual A {
35  // appended to the A subobject's vftable in slot #1.
36  virtual C *foo(); // expected-note{{covariant thunk required by 'foo'}}
37};
38
39struct D : B, C { // expected-error{{ambiguous vftable component}}
40  virtual D *foo();
41  D();
42};
43D::D() {}
44#endif
45