Merge from mainline
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.pt / t39.C
blob8f9bead3a715082bbb44c92123b295759f875616
1 // { dg-do run  }
2 extern "C" int printf (const char *, ...);
4 template <class T>
5 struct frob {
6   T *ptr;
7   void print ();
8   frob (T* init) { ptr = init; }
9 };
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]);
18   static int x[10];
19   frob<const char> fc ("hello");
20   frob<int> fi (x);
22 int main () {
23   fc.print ();
24   fi.print ();
25   return 0;