summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/init12.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/init12.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init12.C22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init12.C b/gcc/testsuite/g++.old-deja/g++.other/init12.C
new file mode 100644
index 000000000..9b7242699
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init12.C
@@ -0,0 +1,22 @@
+// { dg-do link }
+// { dg-options "-O3" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+typedef int (*fp)();
+
+struct S
+{
+ fp f;
+};
+
+struct T
+{
+ static int f() { return 0; }
+};
+
+static const S s = { &T::f };
+
+int main()
+{
+ return (*s.f)();
+}