diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/union3.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/union3.C | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/union3.C b/gcc/testsuite/g++.old-deja/g++.other/union3.C new file mode 100644 index 000000000..67903b761 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/union3.C @@ -0,0 +1,24 @@ +// { dg-do run } +// Origin: Mark Mitchell <mark@codesourcery.com> + +struct A +{ + union + { + int i; + }; + int j; + + A (); +}; + +A::A () + : i (1), j (i = 0) +{ +} + +int main () +{ + A a; + return a.i; +} |