aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/union2.C
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2010-07-23 19:37:40 +0000
committerH.J. Lu <hongjiu.lu@intel.com>2010-07-23 19:37:40 +0000
commite59b0ef2e7a1fb44791d473ee416aeb01fcb169c (patch)
tree437dca120093cc7b1f6debf6f6b31779526c7192 /gcc/testsuite/g++.dg/cpp0x/union2.C
parentf25b023a0d9de6a6c1e1965d93ba6028cb03fc7d (diff)
parent92ac755201aad4366eaff2b75b3239637bee3590 (diff)
Merged with trunk at revision 162480.ifunc
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ifunc@162483 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/union2.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/union2.C34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/union2.C b/gcc/testsuite/g++.dg/cpp0x/union2.C
new file mode 100644
index 00000000000..4f193e281c8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/union2.C
@@ -0,0 +1,34 @@
+// Positive test for C++0x unrestricted unions
+// { dg-options -std=c++0x }
+
+struct A
+{
+ A();
+ A(const A&);
+ ~A();
+};
+
+union B
+{
+ A a;
+ B();
+ B(const B&);
+ ~B();
+};
+
+B b;
+B b2(b);
+
+struct C
+{
+ union
+ {
+ A a;
+ };
+ C();
+ C(const C&);
+ ~C();
+};
+
+C c;
+C c2(c);