Index: lib/Sema/SemaDecl.cpp
===================================================================
--- lib/Sema/SemaDecl.cpp	(revision 117723)
+++ lib/Sema/SemaDecl.cpp	(working copy)
@@ -2947,7 +2947,9 @@
   // Don't diagnose declarations at file scope.  The scope might not
   // have a DeclContext if (e.g.) we're parsing a function prototype.
   DeclContext *NewDC = static_cast<DeclContext*>(S->getEntity());
-  if (NewDC && NewDC->isFileContext())
+  if (NewDC && (NewDC->isFileContext()
+                // Also ignore all record members.
+                || isa<RecordDecl>(NewDC)))
     return;
   
   // Only diagnose if we're shadowing an unambiguous field or variable.
@@ -2960,20 +2962,6 @@
 
   DeclContext *OldDC = ShadowedDecl->getDeclContext();
 
-  // Only warn about certain kinds of shadowing for class members.
-  if (NewDC && NewDC->isRecord()) {
-    // In particular, don't warn about shadowing non-class members.
-    if (!OldDC->isRecord())
-      return;
-
-    // TODO: should we warn about static data members shadowing
-    // static data members from base classes?
-    
-    // TODO: don't diagnose for inaccessible shadowed members.
-    // This is hard to do perfectly because we might friend the
-    // shadowing context, but that's just a false negative.
-  }
-
   // Determine what kind of declaration we're shadowing.
   unsigned Kind;
   if (isa<RecordDecl>(OldDC)) {
