brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · c05fc17 Raw
45 lines · cpp
1// RUN: %clang_cc1 %s -emit-llvm-only -triple=i386-pc-win32 -verify -DTEST12// RUN: %clang_cc1 %s -emit-llvm-only -triple=i386-pc-win32 -verify -DTEST23 4#ifdef TEST15struct 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#endif23 24#ifdef TEST225struct A {26  virtual A *foo(); // in vftable slot #027};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#endif45