Workaround MSVC14 bug on nested class access scope:

https://developercommunity.visualstudio.com/t/cannot-access-to-protected-member-in-base-class-fr/428946

PiperOrigin-RevId: 399498017
Change-Id: I9d7edbd79b49270d22067c180b5fd790ff3db774
diff --git a/tensorflow/core/platform/refcount.h b/tensorflow/core/platform/refcount.h
index 9f2cb2d..30353a3 100644
--- a/tensorflow/core/platform/refcount.h
+++ b/tensorflow/core/platform/refcount.h
@@ -144,6 +144,9 @@
 
   template <typename T>
   friend class WeakPtr;
+  // MSVC14 workaround: access permission of a nested class member is not
+  // treated as an ordinary member in MSVC14.
+  friend struct WeakRefData;
 };
 
 // A weak reference to a WeakRefCounted object. See WeakRefCounted.