[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / mangle-ms-templates-memptrs-2.cpp
blob43f37c32f84aebc9bbfd2b99c877fee681f7ff2a
1 // RUN: %clang_cc1 -Wno-microsoft -fms-extensions -fno-rtti -std=c++11 -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
3 template <typename T, int (T::*)() = nullptr>
4 struct J {};
6 template <typename T, int T::* = nullptr>
7 struct K {};
9 struct __single_inheritance M;
10 J<M> m;
11 // CHECK-DAG: @"?m@@3U?$J@UM@@$0A@@@A"
13 K<M> m2;
14 // CHECK-DAG: @"?m2@@3U?$K@UM@@$0?0@@A"
16 struct __multiple_inheritance N;
17 J<N> n;
18 // CHECK-DAG: @"?n@@3U?$J@UN@@$HA@@@A"
20 K<N> n2;
21 // CHECK-DAG: @"?n2@@3U?$K@UN@@$0?0@@A"
23 struct __virtual_inheritance O;
24 J<O> o;
25 // CHECK-DAG: @"?o@@3U?$J@UO@@$IA@A@@@A"
27 K<O> o2;
28 // CHECK-DAG: @"?o2@@3U?$K@UO@@$FA@?0@@A"
30 struct P;
31 J<P> p;
32 // CHECK-DAG: @"?p@@3U?$J@UP@@$JA@A@?0@@A"
34 K<P> p2;
35 // CHECK-DAG: @"?p2@@3U?$K@UP@@$GA@A@?0@@A"
37 #pragma pointers_to_members(full_generality, virtual_inheritance)
39 struct S {
40 int a, b;
41 void f();
42 virtual void g();
45 struct GeneralBase {
46 virtual void h();
48 struct MostGeneral : S, virtual GeneralBase {
49 virtual void h();
51 template <void (MostGeneral::*MP)()>
52 struct ClassTemplate {
53 ClassTemplate() {}
56 template struct ClassTemplate<&MostGeneral::h>;
58 // Test that we mangle in the vbptr offset, which is 12 here.
60 // CHECK: define weak_odr dso_local x86_thiscallcc noundef ptr @"??0?$ClassTemplate@$J??_9MostGeneral@@$BA@AEA@M@3@@QAE@XZ"