Index: tests/RefCntTest.cpp |
diff --git a/tests/RefCntTest.cpp b/tests/RefCntTest.cpp |
index 60a34ecf886826ecaa972ac612c18ee1d1d8a702..8914ccff49a092fc2ca8d337cf80a1f9090fb15a 100644 |
--- a/tests/RefCntTest.cpp |
+++ b/tests/RefCntTest.cpp |
@@ -274,3 +274,19 @@ DEF_TEST(sk_sp, reporter) { |
check(reporter, 1, 2, 1, 1); |
} |
+namespace { |
+struct FooAbstract : public SkRefCnt { |
+ virtual void f() = 0; |
+}; |
+struct FooConcrete : public FooAbstract { |
+ void f() override {} |
+}; |
+} |
+static sk_sp<FooAbstract> make_foo() { |
+ // can not cast FooConcrete to FooAbstract. |
+ // can cast FooConcrete* to FooAbstract*. |
+ return sk_make_sp<FooConcrete>(); |
+} |
+DEF_TEST(sk_make_sp, r) { |
+ auto x = make_foo(); |
+} |