Implement the new C++0x rules for non-trivial things in unions so that
my defaulted constructor tests stop yelling at me about them.
llvm-svn: 131432
diff --git a/clang/test/SemaCXX/cxx0x-nontrivial-union.cpp b/clang/test/SemaCXX/cxx0x-nontrivial-union.cpp
new file mode 100644
index 0000000..666e64b
--- /dev/null
+++ b/clang/test/SemaCXX/cxx0x-nontrivial-union.cpp
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s
+
+struct non_trivial {
+ non_trivial();
+ non_trivial(const non_trivial&);
+ non_trivial& operator = (const non_trivial&);
+ ~non_trivial();
+};
+
+union u {
+ non_trivial nt;
+};
+
+union bad {
+ static int i; // expected-error {{static data member}}
+};
+
+struct s {
+ union {
+ non_trivial nt;
+ };
+};