OSDN Git Service

Formatting fixes.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.pt / memtemp11.C
1 // { dg-do link  }
2 // GROUPS passed templates membertemplates
3 extern "C" int printf(const char*, ...);
4
5 struct S
6 {
7   template <class U>
8   S(U u, int i) {}
9
10   template <class T>
11   T foo(T t) 
12   { 
13     printf("Hello, world.\n");
14     return t; 
15   }
16 };
17
18
19 int main()
20 {
21   S s(3, 4);
22   int i = s.foo(3);
23   s.foo("hello");
24   s.foo(s);
25   
26   S s2("hello", 5);
27 }