Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3398)

Unified Diff: Source/wtf/OwnPtr.h

Issue 23531003: Type check when upcasting PassOwnPtr/PassOwnArrayPtr to avoid possible function call ambiguousness (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/wtf/OwnArrayPtr.h ('k') | Source/wtf/PassOwnArrayPtr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/OwnPtr.h
diff --git a/Source/wtf/OwnPtr.h b/Source/wtf/OwnPtr.h
index c4feaeb0f421291e749d0eccba78285ab6032bd8..e5baf9341e8ae4ff56e68536d470c6dedbfb087b 100644
--- a/Source/wtf/OwnPtr.h
+++ b/Source/wtf/OwnPtr.h
@@ -48,7 +48,7 @@ namespace WTF {
OwnPtr(std::nullptr_t) : m_ptr(0) { }
// See comment in PassOwnPtr.h for why this takes a const reference.
- template<typename U> OwnPtr(const PassOwnPtr<U>& o);
+ template<typename U> OwnPtr(const PassOwnPtr<U>&, EnsurePtrConvertibleArgDecl(U, T));
#if !COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES)
// This copy constructor is used implicitly by gcc when it generates
@@ -109,7 +109,7 @@ namespace WTF {
PtrType m_ptr;
};
- template<typename T> template<typename U> inline OwnPtr<T>::OwnPtr(const PassOwnPtr<U>& o)
+ template<typename T> template<typename U> inline OwnPtr<T>::OwnPtr(const PassOwnPtr<U>& o, EnsurePtrConvertibleArgDefn(U, T))
: m_ptr(o.leakPtr())
{
}
« no previous file with comments | « Source/wtf/OwnArrayPtr.h ('k') | Source/wtf/PassOwnArrayPtr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698