diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/union4.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/union4.C | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/union4.C b/gcc/testsuite/g++.old-deja/g++.other/union4.C new file mode 100644 index 000000000..26f12e953 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/union4.C @@ -0,0 +1,33 @@ +// { dg-do assemble } +// { dg-options "" } +// Origin: Mark Mitchell <mark@codesourcery.com> + +union A +{ + int i; + int j; + + A () : i (3), j (2) {} // { dg-error "" } multiple initializations +}; + +union B +{ + int i; + union { + int j; + }; + + B () : i (3), j (2) {} // { dg-error "" } multiple initializations +}; + +union C +{ + union { + struct { + int i; + int j; + }; + }; + + C () : i (3), j (2) {} +}; |