2010-10-27 06:47:47 +08:00
|
|
|
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
|
|
|
|
// rdar: // 8562966
|
|
|
|
// pr8409
|
|
|
|
|
2011-04-12 09:46:54 +08:00
|
|
|
// CHECK: @_ZN1CIiE11needs_guardE = weak_odr global
|
|
|
|
// CHECK: @_ZGVN1CIiE11needs_guardE = weak_odr global
|
2010-10-27 06:47:47 +08:00
|
|
|
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
|