gcc/testsuite/g++.dg/modules/indirect-2_a.C
raw| 1 | // { dg-module-do run } |
| 2 | // { dg-additional-options "-fmodules-ts" } |
| 3 | |
| 4 | // indirect references to import, simple templates |
| 5 | |
| 6 | export module foo; |
| 7 | // { dg-module-cmi foo } |
| 8 | |
| 9 | namespace foo |
| 10 | { |
| 11 | export template<int I> int frob () |
| 12 | { |
| 13 | return I; |
| 14 | } |
| 15 | |
| 16 | export template<int I> class X |
| 17 | { |
| 18 | int i = I; |
| 19 | |
| 20 | public: |
| 21 | operator int () const { return i; } |
| 22 | }; |
| 23 | } |
| 24 |