Merge pull request #411 from jagerman/debug-build-and-fix

Debug build and fix
This commit is contained in:
Wenzel Jakob 2016-09-13 09:27:09 +09:00 committed by GitHub
commit 29b5064e9c
2 changed files with 3 additions and 2 deletions

View File

@ -19,7 +19,7 @@ matrix:
env: PYTHON=2.7 CPP=14 GCC=6
- sudo: true
services: docker
env: PYTHON=3.5 CPP=14 GCC=6
env: PYTHON=3.5 CPP=14 GCC=6 DEBUG=1
- os: osx
osx_image: xcode7.3
env: PYTHON=2.7 CPP=14 CLANG
@ -59,6 +59,7 @@ before_install:
fi
if [ -n "$CPP" ]; then export CPP=-std=c++$CPP; fi
if [ "${PYTHON:0:1}" = "3" ]; then export PY=3; fi
if [ -n "$DEBUG" ]; then export CMAKE_EXTRA_ARGS="-DCMAKE_BUILD_TYPE=Debug"; fi
- |
# Initialize enviornment
if [ -n "$DOCKER" ]; then

View File

@ -864,7 +864,7 @@ template <typename type> using cast_is_temporary_value_reference = bool_constant
>;
// Basic python -> C++ casting; throws if casting fails
template <typename TypeCaster> TypeCaster &load_type(TypeCaster &conv, const handle &handle) {
template <typename T, typename SFINAE> type_caster<T, SFINAE> &load_type(type_caster<T, SFINAE> &conv, const handle &handle) {
if (!conv.load(handle, true)) {
#if defined(NDEBUG)
throw cast_error("Unable to cast Python instance to C++ type (compile in debug mode for details)");