Debian Codegraph @

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

raw
1 // { dg-do run }
2 extern "C" int printf (const char *, ...);
3
4 template <class T>
5 struct frob {
6 T *ptr;
7 void print ();
8 frob (T* init) { ptr = init; }
9 };
10
11 template <class T>
12 void frob<T>::print () {
13 printf ("this = %08x\n", this);
14 printf (" ptr = %08x\n", ptr);
15 printf (" values = %x %x %x ...\n", ptr[0], ptr[1], ptr[2]);
16 }
17
18 static int x[10];
19 frob<const char> fc ("hello");
20 frob<int> fi (x);
21
22 int main () {
23 fc.print ();
24 fi.print ();
25 return 0;
26 }