summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/t39.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/t39.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/t39.C26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/t39.C b/gcc/testsuite/g++.old-deja/g++.pt/t39.C
new file mode 100644
index 000000000..8f9bead3a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/t39.C
@@ -0,0 +1,26 @@
+// { dg-do run }
+extern "C" int printf (const char *, ...);
+
+template <class T>
+struct frob {
+ T *ptr;
+ void print ();
+ frob (T* init) { ptr = init; }
+};
+
+template <class T>
+void frob<T>::print () {
+ printf ("this = %08x\n", this);
+ printf (" ptr = %08x\n", ptr);
+ printf (" values = %x %x %x ...\n", ptr[0], ptr[1], ptr[2]);
+}
+
+ static int x[10];
+ frob<const char> fc ("hello");
+ frob<int> fi (x);
+
+int main () {
+ fc.print ();
+ fi.print ();
+ return 0;
+}