Debian Codegraph @

gcc/testsuite/g++.dg/modules/tls-3.h

raw
1 inline thread_local int tla;
2 inline int& get_tla() {
3 return tla;
4 }
5
6 static thread_local int tlb;
7 static int& get_tlb() {
8 return tlb;
9 }
10
11 struct test {
12 static const test& get_instance() {
13 return instance;
14 }
15 static thread_local test instance;
16 };
17
18 template <typename T>
19 struct test_template {
20 static const test_template& get_instance() {
21 return instance;
22 }
23 static thread_local test_template instance;
24
25 template <typename U>
26 static const test_template& get_template_instance() {
27 return template_instance<U>;
28 }
29
30 template <typename U>
31 static thread_local test_template template_instance;
32 };
33
34 template <typename T>
35 thread_local test_template<T> test_template<T>::instance;
36
37 template <typename T>
38 template <typename U>
39 thread_local test_template<T> test_template<T>::template_instance;
40
41 template struct test_template<int>;
42 template const test_template<int>& test_template<int>::get_template_instance<int>();