gcc/testsuite/g++.dg/modules/extern-tpl-1_a.H
raw| 1 | // { dg-module-do link } |
| 2 | // { dg-additional-options -fmodule-header } |
| 3 | // { dg-module-cmi {} } |
| 4 | |
| 5 | template <unsigned I> struct TPL |
| 6 | { |
| 7 | int Source () |
| 8 | { |
| 9 | return I; |
| 10 | } |
| 11 | }; |
| 12 | |
| 13 | extern template class TPL<1>; |
| 14 | |
| 15 | struct Foo |
| 16 | { |
| 17 | TPL<1> m; |
| 18 | |
| 19 | Foo () {m.Source ();}; |
| 20 | |
| 21 | }; |
| 22 | |
| 23 | static Foo __ioinit; |