aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/dllexport-ms-friend.cpp
blob: 7bcf5905e5e5881f1d1c0399b60dfa57466e0cc7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// RUN: %clang_cc1 -triple %ms_abi_triple -fms-extensions -emit-llvm -O0 -o - %s | FileCheck %s

// Friend functions defined in classes are emitted.
// CHECK: define weak_odr dllexport void @"\01?friend1@@YAXXZ"()
struct FuncFriend1 {
  friend __declspec(dllexport) void friend1() {}
};

// But function templates and functions defined in class templates are not
// emitted.
// CHECK-NOT: friend2
// CHECK-NOT: friend3
// CHECK-NOT: friend4
struct FuncFriend2 {
  template<typename> friend __declspec(dllexport) void friend2() {}
};
template<typename> struct FuncFriend3 {
  friend __declspec(dllexport) void friend3() {}
  struct Inner {
    friend __declspec(dllexport) void friend4() {}
  };
};