https://bugs.webkit.org/show_bug.cgi?id=122745
Reviewed by Anders Carlsson.
* wtf/PassOwnPtr.h:
(WTF::adoptPtr): When the object's type is convertible to the RefCountedBase or ThreadSafeRefCountedBase type,
the static assertion should note that adoptRef should be used instead.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157402
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-10-14 Zan Dobersek <zdobersek@igalia.com>
+
+ Static assertions in WTF::adoptPtr should point to using adoptRef for ref-counted objects
+ https://bugs.webkit.org/show_bug.cgi?id=122745
+
+ Reviewed by Anders Carlsson.
+
+ * wtf/PassOwnPtr.h:
+ (WTF::adoptPtr): When the object's type is convertible to the RefCountedBase or ThreadSafeRefCountedBase type,
+ the static assertion should note that adoptRef should be used instead.
+
2013-10-14 Anders Carlsson <andersca@apple.com>
WebKit Nightlies broken by r157374
template<typename T> inline PassOwnPtr<T> adoptPtr(T* ptr)
{
- static_assert(!std::is_convertible<T*, RefCountedBase*>::value, "Do not use adoptPtr with RefCounted, use adoptPtr!");
- static_assert(!std::is_convertible<T*, ThreadSafeRefCountedBase*>::value, "Do not use adoptPtr with ThreadSafeRefCounted, use adoptPtr!");
+ static_assert(!std::is_convertible<T*, RefCountedBase*>::value, "Do not use adoptPtr with RefCounted, use adoptRef!");
+ static_assert(!std::is_convertible<T*, ThreadSafeRefCountedBase*>::value, "Do not use adoptPtr with ThreadSafeRefCounted, use adoptRef!");
return PassOwnPtr<T>(ptr);
}