diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/init2.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/init2.C | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init2.C b/gcc/testsuite/g++.old-deja/g++.other/init2.C new file mode 100644 index 000000000..681229241 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/init2.C @@ -0,0 +1,21 @@ +// { dg-do run } +// { dg-options "-O3" } + +typedef int (*fp)(); + +struct S +{ + fp f; +}; + +static int f() +{ + return 0; +} + +static const S s = { &f }; + +int main() +{ + return (*s.f)(); +} |