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

Unified Diff: Source/wtf/OwnArrayPtr.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 | « no previous file | Source/wtf/OwnPtr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/OwnArrayPtr.h
diff --git a/Source/wtf/OwnArrayPtr.h b/Source/wtf/OwnArrayPtr.h
index c039fbe82f943a87fb7127e62ea2e9b0d3ce4e0b..a678159e096f6222d0ef67f281a4adac0eb68cff 100644
--- a/Source/wtf/OwnArrayPtr.h
+++ b/Source/wtf/OwnArrayPtr.h
@@ -39,7 +39,7 @@ public:
OwnArrayPtr() : m_ptr(0) { }
// See comment in PassOwnArrayPtr.h for why this takes a const reference.
- template<typename U> OwnArrayPtr(const PassOwnArrayPtr<U>& o);
+ template<typename U> OwnArrayPtr(const PassOwnArrayPtr<U>&, EnsurePtrConvertibleArgDecl(U, T));
// This copy constructor is used implicitly by gcc when it generates
// transients for assigning a PassOwnArrayPtr<T> object to a stack-allocated
@@ -76,7 +76,7 @@ private:
PtrType m_ptr;
};
-template<typename T> template<typename U> inline OwnArrayPtr<T>::OwnArrayPtr(const PassOwnArrayPtr<U>& o)
+template<typename T> template<typename U> inline OwnArrayPtr<T>::OwnArrayPtr(const PassOwnArrayPtr<U>& o, EnsurePtrConvertibleArgDefn(U, T))
: m_ptr(o.leakPtr())
{
}
« no previous file with comments | « no previous file | Source/wtf/OwnPtr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698