1// { dg-do run } 2extern "C" int printf (const char *, ...); 3 4template <class T> 5struct frob { 6 T *ptr; 7 void print (); 8 frob (T* init) { ptr = init; } 9}; 10 11template <class T> 12void 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 22int main () { 23 fc.print (); 24 fi.print (); 25 return 0; 26} 27