From e9bb843edca5aed30eae341a8903998782c42679 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Tue, 22 Aug 2017 10:37:51 -0400 Subject: [PATCH] Fix clang5 warnings --- include/pybind11/numpy.h | 4 ++-- tests/test_factory_constructors.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index 4bea4602..ce8c329b 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -342,7 +342,7 @@ public: * dimensionality, this is not checked (and so is up to the caller to use safely). */ template const T &operator()(Ix... index) const { - static_assert(sizeof...(Ix) == Dims || Dynamic, + static_assert(ssize_t{sizeof...(Ix)} == Dims || Dynamic, "Invalid number of indices for unchecked array reference"); return *reinterpret_cast(data_ + byte_offset_unsafe(strides_, ssize_t(index)...)); } @@ -391,7 +391,7 @@ class unchecked_mutable_reference : public unchecked_reference { public: /// Mutable, unchecked access to data at the given indices. template T& operator()(Ix... index) { - static_assert(sizeof...(Ix) == Dims || Dynamic, + static_assert(ssize_t{sizeof...(Ix)} == Dims || Dynamic, "Invalid number of indices for unchecked array reference"); return const_cast(ConstBase::operator()(index...)); } diff --git a/tests/test_factory_constructors.cpp b/tests/test_factory_constructors.cpp index 767fe0ed..fb33377b 100644 --- a/tests/test_factory_constructors.cpp +++ b/tests/test_factory_constructors.cpp @@ -177,7 +177,7 @@ TEST_SUBMODULE(factory_constructors, m) { // Stateful & reused: int c = 1; - auto c4a = [c](pointer_tag, TF4_tag, int a) { return new TestFactory4(a);}; + auto c4a = [c](pointer_tag, TF4_tag, int a) { (void) c; return new TestFactory4(a);}; // test_init_factory_basic, test_init_factory_casting py::class_>(m, "TestFactory3")