Revert 103247, it causes lots of test failures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103248 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp
index 5394924..609d64c 100644
--- a/lib/AST/DeclPrinter.cpp
+++ b/lib/AST/DeclPrinter.cpp
@@ -214,7 +214,11 @@
     if (PrintAccess) {
       AccessSpecifier AS = D->getAccess();
 
-      if (AS != CurAS) {
+      // This is a hack: when a struct is declared in a member declaration
+      // struct outer { struct inner *ptr; }; then we encounter the struct
+      // decl, but it has no access specifier.
+      // The correct solution is to merge this with the member.
+      if (AS != CurAS && AS != AS_none) {
         if (Indent)
           this->Indent(Indentation - Policy.Indentation);
         Print(AS);
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 56288ea..3ac4d13 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -2670,7 +2670,7 @@
       return move(Result);
   }
 
-  return BuildMemberReferenceExpr(ExprArg(*this, Base), Base->getType(),
+  return BuildMemberReferenceExpr(ExprArg(*this, Base), BaseType,
                                   OpLoc, IsArrow, SS, FirstQualifierInScope,
                                   R, TemplateArgs);
 }