diff options
Diffstat (limited to 'base/bind_unittest.cc')
-rw-r--r-- | base/bind_unittest.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/base/bind_unittest.cc b/base/bind_unittest.cc index 0c24710..648096d 100644 --- a/base/bind_unittest.cc +++ b/base/bind_unittest.cc @@ -15,6 +15,8 @@ using ::testing::StrictMock; namespace base { namespace { +class IncompleteType; + class NoRef { public: NoRef() {} @@ -362,6 +364,7 @@ TEST_F(BindTest, IgnoreReturn) { // - Argument binding to a literal string. // - Argument binding with template function. // - Argument binding to an object. +// - Argument binding to pointer to incomplete type. // - Argument gets type converted. // - Pointer argument gets converted. // - Const Reference forces conversion. @@ -391,6 +394,11 @@ TEST_F(BindTest, ArgumentBinding) { Callback<int(void)> bind_object_cb = Bind(&UnwrapNoRefParent, p); EXPECT_EQ(5, bind_object_cb.Run()); + IncompleteType* incomplete_ptr = reinterpret_cast<IncompleteType*>(123); + Callback<IncompleteType*(void)> bind_incomplete_ptr_cb = + Bind(&PolymorphicIdentity<IncompleteType*>, incomplete_ptr); + EXPECT_EQ(incomplete_ptr, bind_incomplete_ptr_cb.Run()); + NoRefChild c; c.value = 6; Callback<int(void)> bind_promotes_cb = Bind(&UnwrapNoRefParent, c); |