[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / microsoft-abi-vtables-ambiguous.cpp
blobc05fc172bc176ad710a969eb1bedfdc3fa4ae738
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
4 #ifdef TEST1
5 struct A {
6 virtual A *foo(); // in vftable slot #0.
7 virtual A *bar(); // in vftable slot #1.
8 };
10 struct 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'}}
15 struct 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'}}
20 struct D : B, C { D(); }; // expected-error{{ambiguous vftable component}}
21 D::D() {}
22 #endif
24 #ifdef TEST2
25 struct A {
26 virtual A *foo(); // in vftable slot #0
29 struct 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'}}
34 struct 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'}}
39 struct D : B, C { // expected-error{{ambiguous vftable component}}
40 virtual D *foo();
41 D();
43 D::D() {}
44 #endif