Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 1 | // RUN: %clang_cc1 -Wno-microsoft -fms-extensions -fno-rtti -std=c++11 -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s |
| 2 | |
Stephen Hines | c568f1e | 2014-07-21 00:47:37 -0700 | [diff] [blame] | 3 | template <typename T, int (T::*)() = nullptr> |
| 4 | struct J {}; |
| 5 | |
| 6 | struct __single_inheritance M; |
| 7 | J<M> m; |
| 8 | // CHECK-DAG: @"\01?m@@3U?$J@UM@@$0A@@@A" |
| 9 | |
| 10 | struct __multiple_inheritance N; |
| 11 | J<N> n; |
| 12 | // CHECK-DAG: @"\01?n@@3U?$J@UN@@$HA@@@A" |
| 13 | |
| 14 | struct __virtual_inheritance O; |
| 15 | J<O> o; |
| 16 | // CHECK-DAG: @"\01?o@@3U?$J@UO@@$IA@A@@@A" |
| 17 | |
| 18 | struct P; |
| 19 | J<P> p; |
| 20 | // CHECK-DAG: @"\01?p@@3U?$J@UP@@$JA@A@?0@@A" |
| 21 | |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 22 | #pragma pointers_to_members(full_generality, virtual_inheritance) |
| 23 | |
| 24 | struct S { |
| 25 | int a, b; |
| 26 | void f(); |
| 27 | virtual void g(); |
| 28 | }; |
| 29 | |
| 30 | struct GeneralBase { |
| 31 | virtual void h(); |
| 32 | }; |
| 33 | struct MostGeneral : S, virtual GeneralBase { |
| 34 | virtual void h(); |
| 35 | }; |
| 36 | template <void (MostGeneral::*MP)()> |
| 37 | struct ClassTemplate { |
| 38 | ClassTemplate() {} |
| 39 | }; |
| 40 | |
| 41 | template struct ClassTemplate<&MostGeneral::h>; |
| 42 | |
| 43 | // Test that we mangle in the vbptr offset, which is 12 here. |
| 44 | // |
| 45 | // CHECK: define weak_odr x86_thiscallcc %struct.ClassTemplate* @"\01??0?$ClassTemplate@$J??_9MostGeneral@@$BA@AEA@M@3@@QAE@XZ" |