| 1 |
// PR c++/113292 |
| 2 |
// { dg-additional-options "-fmodule-header" } |
| 3 |
// { dg-module-cmi {} } |
| 4 |
|
| 5 |
struct test { |
| 6 |
static const test& get_instance() { |
| 7 |
return instance; |
| 8 |
} |
| 9 |
static thread_local test instance; |
| 10 |
}; |
| 11 |
|
| 12 |
|
| 13 |
template <typename T> |
| 14 |
struct test_template { |
| 15 |
static const test_template& get_instance() { |
| 16 |
return instance; |
| 17 |
} |
| 18 |
static thread_local test_template instance; |
| 19 |
|
| 20 |
template <typename U> |
| 21 |
static const test_template& get_template_instance() { |
| 22 |
return template_instance<U>; |
| 23 |
} |
| 24 |
|
| 25 |
template <typename U> |
| 26 |
static thread_local test_template template_instance; |
| 27 |
}; |
| 28 |
|
| 29 |
template <typename T> |
| 30 |
thread_local test_template<T> test_template<T>::instance; |
| 31 |
|
| 32 |
template <typename T> |
| 33 |
template <typename U> |
| 34 |
thread_local test_template<T> test_template<T>::template_instance; |