Index: lib/Sema/SemaDecl.cpp
===================================================================
--- lib/Sema/SemaDecl.cpp	(version 150684)
+++ lib/Sema/SemaDecl.cpp	(working copy)
@@ -2424,12 +2424,13 @@
   if (getLangOptions().MicrosoftExt && !getLangOptions().CPlusPlus &&
       CurContext->isRecord() &&
       DS.getStorageClassSpec() == DeclSpec::SCS_unspecified) {
-    // Handle 2 kinds of anonymous struct:
+    // Handle 3 kinds of anonymous struct:
     //   struct STRUCT;
+    //   struct STRUCT{...};
     // and
     //   STRUCT_TYPE;  <- where STRUCT_TYPE is a typedef struct.
     RecordDecl *Record = dyn_cast_or_null<RecordDecl>(Tag);
-    if ((Record && Record->getDeclName() && !Record->isCompleteDefinition()) ||
+    if ((Record && Record->getDeclName()) ||
         (DS.getTypeSpecType() == DeclSpec::TST_typename &&
          DS.getRepAsType().get()->isStructureType())) {
       Diag(DS.getSourceRange().getBegin(), diag::ext_ms_anonymous_struct)
@@ -2954,7 +2955,7 @@
   SmallVector<NamedDecl*, 2> Chain;
   Chain.push_back(Anon);
 
-  RecordDecl *RecordDef = Record->getDefinition();
+  RecordDecl *RecordDef = Record->isCompleteDefinition() ? Record : Record->getDefinition();
   if (!RecordDef || InjectAnonymousStructOrUnionMembers(*this, S, CurContext,
                                                         RecordDef, AS_none,
                                                         Chain, true))
