Emit diagnostic error when the field of an anonymous struct is non trivial.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111158 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/anonymous-struct.cpp b/test/SemaCXX/anonymous-struct.cpp
new file mode 100644
index 0000000..dfa284a
--- /dev/null
+++ b/test/SemaCXX/anonymous-struct.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+struct S {
+  S();  // expected-note {{because type 'S' has a user-declared constructor}}    
+};
+
+struct E {
+  struct {
+    S x;  // expected-error {{anonymous struct member 'x' has a non-trivial constructor}} 
+  };
+};