Improved MSVC __interface support by adding first class support for it, instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163013 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp
index 2f21e4c..c68a16b 100644
--- a/lib/AST/DeclCXX.cpp
+++ b/lib/AST/DeclCXX.cpp
@@ -463,13 +463,14 @@
 }
 
 void CXXRecordDecl::addedMember(Decl *D) {
-  if (!D->isImplicit() &&
-      !isa<FieldDecl>(D) &&
-      !isa<IndirectFieldDecl>(D) &&
-      (!isa<TagDecl>(D) || cast<TagDecl>(D)->getTagKind() == TTK_Class))
-    data().HasOnlyCMembers = false;
-
-  // Ignore friends and invalid declarations.
+  if (!D->isImplicit() &&

+      !isa<FieldDecl>(D) &&

+      !isa<IndirectFieldDecl>(D) &&

+      (!isa<TagDecl>(D) || cast<TagDecl>(D)->getTagKind() == TTK_Class ||

+        cast<TagDecl>(D)->getTagKind() == TTK_Interface))

+    data().HasOnlyCMembers = false;

+

+  // Ignore friends and invalid declarations.

   if (D->getFriendObjectKind() || D->isInvalidDecl())
     return;
   
@@ -933,13 +934,14 @@
     if (Shadow->getDeclName().getNameKind()
           == DeclarationName::CXXConversionFunctionName)
       data().Conversions.addDecl(Shadow, Shadow->getAccess());
-}
-
-bool CXXRecordDecl::isCLike() const {
-  if (getTagKind() == TTK_Class || !TemplateOrInstantiation.isNull())
-    return false;
-  if (!hasDefinition())
-    return true;
+}

+

+bool CXXRecordDecl::isCLike() const {

+  if (getTagKind() == TTK_Class || getTagKind() == TTK_Interface ||

+      !TemplateOrInstantiation.isNull())

+    return false;

+  if (!hasDefinition())

+    return true;

 
   return isPOD() && data().HasOnlyCMembers;
 }