Debian Codegraph @

gcc/testsuite/g++.dg/init/init-ref4.C

raw
1 // Origin: [email protected]
2 // PR c++/11384
3 // foo<int>::_S_something was not being emitted (as a weak definition).
4
5 // { dg-do run }
6 // { dg-require-weak "" }
7
8 template<typename T>
9 struct foo
10 {
11 static const T _S_something;
12 };
13
14 template<typename T>
15 const T foo<T>::_S_something = T();
16
17 int main()
18 {
19 const int* p = &foo<int>::_S_something;
20 return 0;
21 }