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

Unified Diff: base/bind_unittest.nc

Issue 7780016: Make Callback.Equals() only work when comparing against the same type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing file. Created 9 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 | « base/base.gyp ('k') | base/callback.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/bind_unittest.nc
diff --git a/base/bind_unittest.nc b/base/bind_unittest.nc
index 2d07cbb6c3a90c383e94752c3375432e7282186a..eba8747bb26b64ef8abf2f03baaec86228acbf64 100644
--- a/base/bind_unittest.nc
+++ b/base/bind_unittest.nc
@@ -80,27 +80,6 @@ void WontCompile() {
method_to_const_cb.Run();
}
-#elif defined(NCTEST_CONSTRUCTION_FROM_SUBTYPE) // [r"conversion from 'base::Callback<int\(\)>' to non-scalar type 'base::Callback<void\(\)>'"]
-
-// Construction of Callback<A> from Callback<B> if A is supertype of B.
-//
-// While this is technically safe, most people aren't used to it when coding
-// C++ so if this is happening, it is almost certainly an error.
-void WontCompile() {
- Callback<int(void)> cb_a = Bind(&PolymorphicIdentity<int>, 1);
- Callback<void(void)> cb_b = cb_a;
-}
-
-#elif defined(NCTEST_ASSIGNMENT_FROM_SUBTYPE) // [r"no match for 'operator=' in 'cb_a = cb_b'"]
-
-// Assignment of Callback<A> from Callback<B> if A is supertype of B.
-// See explanation for NCTEST_CONSTRUCTION_FROM_SUBTYPE
-void WontCompile() {
- Callback<int(void)> cb_a = Bind(&PolymorphicIdentity<int>, 1);
- Callback<void(void)> cb_b;
- cb_a = cb_b;
-}
-
#elif defined(NCTEST_METHOD_BIND_NEEDS_REFCOUNTED_OBJECT) // [r"has no member named 'AddRef'"]
// Method bound to non-refcounted object.
« no previous file with comments | « base/base.gyp ('k') | base/callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698