Unbreak with clang >=10

This commit is contained in:
ajacoutot 2020-08-13 18:15:04 +00:00
parent 3a3b720046
commit 7eafe5a71a
2 changed files with 88 additions and 0 deletions

View File

@ -0,0 +1,53 @@
$OpenBSD: patch-aux_broker_3rdparty_caf_libcaf_test_caf_test_dsl_hpp,v 1.1 2020/08/13 18:15:04 ajacoutot Exp $
https://github.com/actor-framework/actor-framework/commit/35819b9f257754781850310b9feff352f08ed3d6.patch
From 35819b9f257754781850310b9feff352f08ed3d6 Mon Sep 17 00:00:00 2001
From: Dominik Charousset <dominik.charousset@corelight.com>
Date: Sat, 18 Apr 2020 08:57:29 +0200
Subject: [PATCH] Fix build on Clang 10
Index: aux/broker/3rdparty/caf/libcaf_test/caf/test/dsl.hpp
--- aux/broker/3rdparty/caf/libcaf_test/caf/test/dsl.hpp.orig
+++ aux/broker/3rdparty/caf/libcaf_test/caf/test/dsl.hpp
@@ -334,7 +334,7 @@ class expect_clause { (public)
}
expect_clause& to(const caf::scoped_actor& whom) {
- dest_ = whom.ptr();
+ dest_ = caf::actor_cast<caf::abstract_actor*>(whom);
return *this;
}
@@ -410,7 +410,7 @@ class expect_clause<void> { (public)
}
expect_clause& to(const caf::scoped_actor& whom) {
- dest_ = whom.ptr();
+ dest_ = caf::actor_cast<caf::abstract_actor*>(whom);
return *this;
}
@@ -450,11 +450,6 @@ class inject_clause { (public)
return *this;
}
- inject_clause& to(const caf::scoped_actor& whom) {
- dest_ = whom.ptr();
- return *this;
- }
-
void with(Ts... xs) {
if (src_ == nullptr)
CAF_FAIL("missing .from() in inject() statement");
@@ -525,11 +520,6 @@ class allow_clause { (public)
allow_clause& to(const Handle& whom) {
if (sched_.prioritize(whom))
dest_ = &sched_.next_job<caf::abstract_actor>();
- return *this;
- }
-
- allow_clause& to(const caf::scoped_actor& whom) {
- dest_ = whom.ptr();
return *this;
}

View File

@ -0,0 +1,35 @@
$OpenBSD: patch-aux_broker_bindings_python__broker_cpp,v 1.1 2020/08/13 18:15:04 ajacoutot Exp $
From c358de6dbeb19a8a4d9bf7a6f2fee75671c8eab5 Mon Sep 17 00:00:00 2001
From: Dominik Charousset <dominik@charousset.de>
Date: Fri, 24 Jul 2020 14:57:24 +0200
Subject: [PATCH] Silence self-assign-overloaded warning on Clang
Index: aux/broker/bindings/python/_broker.cpp
--- aux/broker/bindings/python/_broker.cpp.orig
+++ aux/broker/bindings/python/_broker.cpp
@@ -99,8 +99,14 @@ PYBIND11_MODULE(_broker, m) {
py::bind_vector<std::vector<broker::peer_info>>(m, "VectorPeerInfo");
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wself-assign-overloaded"
+#endif
py::class_<broker::topic>(m, "Topic")
.def(py::init<std::string>())
+ // Without the enclosing pragmas, this line raises a nonsensical self-assign
+ // warning on Clang. See https://bugs.llvm.org/show_bug.cgi?id=43124.
.def(py::self /= py::self,
"Appends a topic component with a separator")
.def(py::self / py::self,
@@ -109,6 +115,9 @@ PYBIND11_MODULE(_broker, m) {
"Get the underlying string representation of the topic",
py::return_value_policy::reference_internal)
.def("__repr__", [](const broker::topic& t) { return t.string(); });
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
py::bind_vector<std::vector<broker::topic>>(m, "VectorTopic");