summaryrefslogtreecommitdiffhomepage
path: root/test/bptr.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-05-04 20:13:15 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-05-05 03:31:20 +0200
commit5c54707ed13c2996f36b99dddb76f017765cec72 (patch)
treeed74b0f349822a58c731823e03aee3661a8d74e7 /test/bptr.cpp
parent210ee6eab1dcd7b1b2710dc927943d62330ffde3 (diff)
a w
Diffstat (limited to 'test/bptr.cpp')
-rw-r--r--test/bptr.cpp31
1 files changed, 29 insertions, 2 deletions
diff --git a/test/bptr.cpp b/test/bptr.cpp
index b8e4bef1..99d6cd2c 100644
--- a/test/bptr.cpp
+++ b/test/bptr.cpp
@@ -4,10 +4,38 @@
namespace floormat {
-namespace { struct Foo {}; struct Bar : Foo {}; struct Baz {}; }
+namespace {
+struct Foo {};
+struct Bar : Foo {};
+struct Baz {};
+} // namespace
+
+// NOLINTBEGIN(*-use-anonymous-namespace)
+
template struct detail_borrowed_ptr::control_block_impl<Foo>;
+template struct detail_borrowed_ptr::control_block_impl<Bar>;
+template struct detail_borrowed_ptr::control_block_impl<Baz>;
+
+template bool operator==(const bptr<Foo>&, const bptr<Foo>&) noexcept;
+template bool operator==(const bptr<Bar>&, const bptr<Bar>&) noexcept;
+template bool operator==(const bptr<Baz>&, const bptr<Baz>&) noexcept;
+
template class bptr<Foo>;
+template class bptr<Bar>;
+template class bptr<Baz>;
+
+template bptr<Foo> static_pointer_cast(const bptr<Foo>&) noexcept;
+template bptr<Bar> static_pointer_cast(const bptr<Bar>&) noexcept;
+template bptr<Baz> static_pointer_cast(const bptr<Baz>&) noexcept;
+
template bptr<Bar> static_pointer_cast(const bptr<Foo>&) noexcept;
+template bptr<Foo> static_pointer_cast(const bptr<Bar>&) noexcept;
+
+//template bptr<Baz> static_pointer_cast(const bptr<Bar>&) noexcept; // must fail
+//template bptr<Foo> static_pointer_cast(const bptr<Baz>&) noexcept; // must fail
+//template bptr<Bar> static_pointer_cast(const bptr<Baz>&) noexcept; // must fail
+
+// NOLINTEND(*-use-anonymous-namespace)
namespace {
@@ -22,5 +50,4 @@ void test_app::test_bptr()
test1();
}
-
} // namespace floormat