[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CodeGenCXX / template-linkage.cpp
blob5be067b487a6d5f4b8912af7468ab31e863a0be5
1 // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
3 // CHECK: Outer5Inner{{.*}}localE6memberE = external global
5 template<typename T> struct A {
6 virtual void f(T) { }
7 inline void g() { }
8 };
10 // Explicit instantiations have external linkage.
12 // CHECK-LABEL: define weak_odr void @_ZN1AIiE1gEv(
13 template void A<int>::g();
15 // CHECK-LABEL: define weak_odr void @_ZN1AIfE1fEf(
16 // CHECK-LABEL: define weak_odr void @_ZN1AIfE1gEv(
17 // FIXME: This should also emit the vtable.
18 template struct A<float>;
20 // CHECK-LABEL: define weak_odr void @_Z1fIiEvT_
21 template <typename T> void f(T) { }
22 template void f<int>(int);
24 // CHECK-LABEL: define weak_odr void @_Z1gIiEvT_
25 template <typename T> inline void g(T) { }
26 template void g<int>(int);
28 template<typename T>
29 struct X0 {
30 virtual ~X0() { }
33 template<typename T>
34 struct X1 : X0<T> {
35 virtual void blarg();
38 template<typename T> void X1<T>::blarg() { }
40 extern template struct X0<char>;
41 extern template struct X1<char>;
43 // CHECK-LABEL: define linkonce_odr void @_ZN2X1IcED1Ev(%struct.X1* {{[^,]*}} %this) unnamed_addr
44 void test_X1() {
45 X1<char> i1c;
48 namespace PR14825 {
49 struct Outer {
50 template <typename T> struct Inner {
51 static int member;
53 template <typename T> void Get() {
54 int m = Inner<T>::member;
58 void test() {
59 struct local {};
60 Outer o;
61 typedef void (Outer::*mptr)();
62 mptr method = &Outer::Get<local>;