Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.pt/memtemp20.C

raw
1 // { dg-do link }
2 // GROUPS passed templates membertemplates
3 extern "C" int printf(const char*, ...);
4
5 struct S
6 {
7 template <class T, class U>
8 void foo(T t, U u);
9
10 template <class U>
11 void foo(char*, U);
12
13 void foo(int i);
14 };
15
16 template <class T, class U>
17 void S::foo(T t, U u)
18 {
19 printf ("T,U version\n");
20 }
21
22
23 template <class U>
24 void S::foo(char*, U u)
25 {
26 printf ("char*,U version\n");
27 }
28
29
30 void S::foo(int i)
31 {
32 printf ("int version\n");
33 }
34
35
36 int main()
37 {
38 S s;
39 s.foo(3);
40 s.foo(3, 3);
41 s.foo("abc", s);
42 }
43