diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/init16.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/init16.C | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init16.C b/gcc/testsuite/g++.old-deja/g++.other/init16.C new file mode 100644 index 000000000..de4c0ad97 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/init16.C @@ -0,0 +1,29 @@ +// { dg-do run } +// Origin: Jakub Jelinek <jakub@redhat.com> + +struct bar { + char c; + bar (const char *); + bar (const bar &); +}; + +struct foo { + bar x; +}; + +extern const struct foo y = { "foo" }; + +bar::bar (const bar &ref) +{ + c = ref.c; +} + +bar::bar (const char *p) +{ + c = p[2]; +} + +int main () +{ + return y.x.c != 'o'; +} |