Add a -pedantic warning: an anonymous union within an anonymous union is not
permitted in standard C++, despite being silently accepted by many (all?) major
C++ implementations.

llvm-svn: 173643
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 136d12e..a5f39a8 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -3198,6 +3198,12 @@
               << (int)Record->isUnion();
             Invalid = true;
           }
+        } else {
+          // This is an anonymous type definition within another anonymous type.
+          // This is a popular extension, provided by Plan9, MSVC and GCC, but
+          // not part of standard C++.
+          Diag(MemRecord->getLocation(),
+               diag::ext_anonymous_record_with_anonymous_type);
         }
       } else if (isa<AccessSpecDecl>(*Mem)) {
         // Any access specifier is fine.