base::Bind is intended to reject raw pointers to ref-counted types unless it's a this pointer.
E.g.:
struct Foo : base::RefCounted<Foo> {};
void Bar(Foo*) {}
void Baz(scoped_refptr<Foo>) {}
Foo* p = nullptr;
base::Bind(&Bar, p); // Should be compile error.
base::Bind(&Baz, p); // Should be compile error.
base::Bind implementation has a static_assert to ban this pattern. However, the check has been regressed from some point and those base::Bind usages compile.
Context: https://groups.google.com/a/chromium.org/d/msg/chromium-dev/qH5swrLHPmg/6E1FE5okAgAJ
Comment 1 by tzik@chromium.org
, Jun 27 2017Status: Duplicate (was: Assigned)