aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/specialized-static-data-mem-init.cpp
blob: 68799624f26e6c2e1f176b62ea6e15e90b19c337 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s
// rdar: // 8562966
// pr8409

// CHECK: @_ZN1CIiE11needs_guardE = linkonce_odr global
// CHECK: @_ZGVN1CIiE11needs_guardE = linkonce_odr global

struct K
{
  K();
  K(const K &);
  ~K();
  void PrintNumK();
};

template<typename T>
struct C
{
  void Go() { needs_guard.PrintNumK(); }
  static K needs_guard;
};

template<typename T> K C<T>::needs_guard;

void F()
{
  C<int>().Go();
}