aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.brendan/template21.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.brendan/template21.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/template21.C43
1 files changed, 43 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/template21.C b/gcc/testsuite/g++.old-deja/g++.brendan/template21.C
new file mode 100644
index 00000000000..9d6139191e0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/template21.C
@@ -0,0 +1,43 @@
+// Build don't link:
+// GROUPS passed templates
+template<class T>
+class L {
+public:
+ L();
+
+ T x[30];
+ int doit(int i) const;
+};
+
+#ifdef BUG
+template<class T>
+int
+L<T>::doit(int i) const
+{
+ return x[i].z;
+}
+#endif
+
+class X {
+public:
+ class Y {
+ public:
+ Y();
+ Y(int);
+
+ int z;
+ };
+
+ L<Y> ly;
+};
+
+#ifndef BUG
+template<class T>
+int
+L<T>::doit(int i) const
+{
+ return x[i].z;
+}
+#endif
+
+static X x;