Debian Codegraph @

gcc/testsuite/g++.dg/modules/var-tpl-1_a.C

raw
1 // { dg-module-do run }
2 // { dg-additional-options -fmodules-ts }
3
4 export module frob;
5 // { dg-module-cmi frob }
6
7 export template<typename T> T sum (T a)
8 {
9 return a;
10 }
11
12 export template<typename T, typename... R>
13 inline T sum (T a, R... b)
14 {
15 return a + static_cast<T> (sum (b...));
16 }
17
18 export inline int add (int a, int b, int c)
19 {
20 return sum (a, b, c);
21 }