summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/template11.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/template11.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/template11.C16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/template11.C b/gcc/testsuite/g++.old-deja/g++.jason/template11.C
new file mode 100644
index 000000000..004361d6c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/template11.C
@@ -0,0 +1,16 @@
+// { dg-do run }
+// Bug: initializers for static data members of templates don't get run.
+
+template <class T> struct A {
+ static T t;
+};
+
+int foo () { return 1; }
+
+template <>
+int A<int>::t = foo ();
+
+int main ()
+{
+ return (A<int>::t != 1);
+}