From 6519388f5c4edc1e6260afdc7aa41657c209dceb Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Sun, 22 Oct 2017 12:06:52 -0300 Subject: [PATCH] Build /permissive- under VS2017 Building with the (VS2017) /permissive- flag puts the compiler into stricter standards-compliant mode. It shouldn't cause the compiler to work differently--it just disallows some non-conforming code--so should be perfectly fine for the test suite under all VS2017 builds. This commit also fixes one failure under non-permissive mode. --- .appveyor.yml | 1 + include/pybind11/cast.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index b150f1014..2d37fc7ae 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -34,6 +34,7 @@ install: if ($env:APPVEYOR_JOB_NAME -like "*Visual Studio 2017*") { $env:CMAKE_GENERATOR = "Visual Studio 15 2017" $env:CMAKE_INCLUDE_PATH = "C:\Libraries\boost_1_64_0" + $env:CXXFLAGS = "-permissive-" } else { $env:CMAKE_GENERATOR = "Visual Studio 14 2015" } diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 9e34c2e57..8c9ea02bc 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -1417,7 +1417,7 @@ protected: bool load_value(value_and_holder &&v_h) { if (v_h.holder_constructed()) { value = v_h.value_ptr(); - holder = v_h.holder(); + holder = v_h.template holder(); return true; } else { throw cast_error("Unable to cast from non-held to held instance (T& to Holder) "