From 2a33f59427bd6b4277db5ad971507ea82b1efeaa Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Sun, 12 Feb 2023 13:12:47 +0100
Subject: [PATCH] [python] Silence false positive self assigment warning

Possible bug in clang is tracked here:
https://bugs.llvm.org/show_bug.cgi?id=43124
---
 dune/python/istl/bvector.hh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dune/python/istl/bvector.hh b/dune/python/istl/bvector.hh
index 81184b80b..ee4f58222 100644
--- a/dune/python/istl/bvector.hh
+++ b/dune/python/istl/bvector.hh
@@ -159,8 +159,20 @@ namespace Dune
       cls.def( "__len__", [] ( const BlockVector &self ) { return self.N(); } );
 
       cls.def( pybind11::self += pybind11::self );
+
+// silence a warning (false positive) emitted by clang
+// https://bugs.llvm.org/show_bug.cgi?id=43124
+#ifdef __clang__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wself-assign-overloaded"
+#endif
+
       cls.def( pybind11::self -= pybind11::self );
 
+#ifdef __clang__
+#pragma GCC diagnostic pop
+#endif
+
       detail::registerOneTensorInterface( cls );
       detail::registerISTLIterators( cls );
 
-- 
GitLab