Index: include/llvm/ADT/IntrusiveRefCntPtr.h =================================================================== --- include/llvm/ADT/IntrusiveRefCntPtr.h (revision 218294) +++ include/llvm/ADT/IntrusiveRefCntPtr.h (revision 218295) @@ -197,6 +197,9 @@ private: void retain() { if (Obj) IntrusiveRefCntPtrInfo::retain(Obj); } void release() { if (Obj) IntrusiveRefCntPtrInfo::release(Obj); } + + template + friend class IntrusiveRefCntPtr; }; template