summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/instan1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/instan1.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/instan1.C24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/instan1.C b/gcc/testsuite/g++.old-deja/g++.other/instan1.C
new file mode 100644
index 000000000..3c294c396
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/instan1.C
@@ -0,0 +1,24 @@
+// { dg-do link }
+// { dg-options "-fno-implicit-templates" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+template <class T>
+struct U {
+ static int j;
+};
+
+template <class T>
+struct S {
+ static const int i = 7;
+};
+
+template <class T>
+const int S<T>::i;
+
+template <class T>
+int U<T>::j = S<T>::i + 5;
+
+template int U<double>::j;
+
+int main () {
+}