pybind11/tests
Jason Rhinelander 6e036e78a7 Support binding noexcept function/methods in C++17
When compiling in C++17 mode the noexcept specifier is part of the
function type.  This causes a failure in pybind11 because, by omitting
a noexcept specifier when deducing function return and argument types,
we are implicitly making `noexcept(false)` part of the type.

This means that functions with `noexcept` fail to match the function
templates in cpp_function (and other places), and we get compilation
failure (we end up trying to fit it into the lambda function version,
which fails since a function pointer has no `operator()`).

We can, however, deduce the true/false `B` in noexcept(B), so we don't
need to add a whole other set of overloads, but need to deduce the extra
argument when under C++17.  That will *not* work under pre-C++17,
however.

This commit adds two macros to fix the problem: under C++17 (with the
appropriate feature macro set) they provide an extra `bool NoExceptions`
template argument and provide the `noexcept(NoExceptions)` deduced
specifier.  Under pre-C++17 they expand to nothing.

This is needed to compile pybind11 with gcc7 under -std=c++17.
2016-12-14 20:40:49 +01:00
..
test_installed_module test installed pybind 2016-12-13 21:44:19 +01:00
test_installed_target test installed pybind 2016-12-13 21:44:19 +01:00
CMakeLists.txt test installed pybind 2016-12-13 21:44:19 +01:00
conftest.py Add checks to maintain a consistent Python code style and prevent bugs (#515) 2016-11-20 21:21:54 +01:00
constructor_stats.h Don't construct unique_ptr around unowned pointers (#478) 2016-11-06 19:12:48 +01:00
object.h minor doc & style fixes 2016-09-06 13:02:29 +09:00
pybind11_tests.cpp Adds automatic casting on assignment of non-pyobject types (#551) 2016-12-12 23:42:52 +01:00
pybind11_tests.h Replace std::cout with py::print in tests 2016-09-07 01:25:27 +02:00
test_alias_initialization.cpp Implement py::init_alias<>() constructors 2016-09-09 03:04:09 -04:00
test_alias_initialization.py Add checks to maintain a consistent Python code style and prevent bugs (#515) 2016-11-20 21:21:54 +01:00
test_buffers.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_buffers.py Port tests to pytest 2016-08-19 13:19:38 +02:00
test_callbacks.cpp Add py::dict() keyword constructor 2016-09-06 16:41:50 +02:00
test_callbacks.py nicer error message for invalid function arguments 2016-09-19 13:43:43 +02:00
test_chrono.cpp Changed non system clocks to be time deltas 2016-09-13 20:40:28 +10:00
test_chrono.py Add checks to maintain a consistent Python code style and prevent bugs (#515) 2016-11-20 21:21:54 +01:00
test_class_args.cpp Support std::shared_ptr holder type out of the box 2016-10-20 16:19:58 +02:00
test_class_args.py Set maximum line length for Python style checker (#552) 2016-12-13 00:59:28 +01:00
test_constants_and_functions.cpp Support binding noexcept function/methods in C++17 2016-12-14 20:40:49 +01:00
test_constants_and_functions.py Support binding noexcept function/methods in C++17 2016-12-14 20:40:49 +01:00
test_copy_move_policies.cpp equals needed for test_copy_move_policies to build icpc 2016.3 (#507) 2016-11-17 11:01:11 +01:00
test_copy_move_policies.py Add checks to maintain a consistent Python code style and prevent bugs (#515) 2016-11-20 21:21:54 +01:00
test_docstring_options.cpp Provide more control over automatic generation of docstrings (#486) 2016-11-15 12:38:05 +01:00
test_docstring_options.py Add checks to maintain a consistent Python code style and prevent bugs (#515) 2016-11-20 21:21:54 +01:00
test_eigen.cpp Adds automatic casting on assignment of non-pyobject types (#551) 2016-12-12 23:42:52 +01:00
test_eigen.py Set maximum line length for Python style checker (#552) 2016-12-13 00:59:28 +01:00
test_enum.cpp make arithmetic operators of enum_ optional (#508) 2016-11-17 23:24:47 +01:00
test_enum.py Add checks to maintain a consistent Python code style and prevent bugs (#515) 2016-11-20 21:21:54 +01:00
test_eval_call.py Add checks to maintain a consistent Python code style and prevent bugs (#515) 2016-11-20 21:21:54 +01:00
test_eval.cpp Make error_already_set fetch and hold the Python error 2016-09-10 12:08:32 +02:00
test_eval.py Rewrite eval tests to allow for simple asserts 2016-08-19 16:31:48 +02:00
test_exceptions.cpp Adds automatic casting on assignment of non-pyobject types (#551) 2016-12-12 23:42:52 +01:00
test_exceptions.py Add checks to maintain a consistent Python code style and prevent bugs (#515) 2016-11-20 21:21:54 +01:00
test_inheritance.cpp Add py::isinstance<T>(obj) for generalized Python type checking 2016-11-17 08:55:42 +01:00
test_inheritance.py Add py::isinstance<T>(obj) for generalized Python type checking 2016-11-17 08:55:42 +01:00
test_issues.cpp Adds automatic casting on assignment of non-pyobject types (#551) 2016-12-12 23:42:52 +01:00
test_issues.py Changed "Invoked with" output to use repr() instead of str() (#518) 2016-11-22 11:28:40 +01:00
test_keep_alive.cpp Replace std::cout with py::print in tests 2016-09-07 01:25:27 +02:00
test_keep_alive.py Add checks to maintain a consistent Python code style and prevent bugs (#515) 2016-11-20 21:21:54 +01:00
test_kwargs_and_defaults.cpp Remove superseded handle::operator() overloads 2016-09-06 16:41:50 +02:00
test_kwargs_and_defaults.py nicer error message for invalid function arguments 2016-09-19 13:43:43 +02:00
test_methods_and_attributes.cpp Add syntax sugar for resolving overloaded functions (#541) 2016-12-08 11:07:52 +01:00
test_methods_and_attributes.py Add syntax sugar for resolving overloaded functions (#541) 2016-12-08 11:07:52 +01:00
test_modules.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_modules.py Simplify tests by replacing output capture with asserts where possible 2016-08-19 13:19:38 +02:00
test_multiple_inheritance.cpp Support std::shared_ptr holder type out of the box 2016-10-20 16:19:58 +02:00
test_multiple_inheritance.py Add checks to maintain a consistent Python code style and prevent bugs (#515) 2016-11-20 21:21:54 +01:00
test_numpy_array.cpp Improve consistency of array and array_t with regard to other pytypes 2016-11-17 08:55:42 +01:00
test_numpy_array.py Add checks to maintain a consistent Python code style and prevent bugs (#515) 2016-11-20 21:21:54 +01:00
test_numpy_dtypes.cpp Use correct itemsize when constructing a numpy dtype from a buffer_info 2016-11-22 22:01:03 +01:00
test_numpy_dtypes.py Set maximum line length for Python style checker (#552) 2016-12-13 00:59:28 +01:00
test_numpy_vectorize.cpp Replace std::cout with py::print in tests 2016-09-07 01:25:27 +02:00
test_numpy_vectorize.py Set maximum line length for Python style checker (#552) 2016-12-13 00:59:28 +01:00
test_opaque_types.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_opaque_types.py Set maximum line length for Python style checker (#552) 2016-12-13 00:59:28 +01:00
test_operator_overloading.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_operator_overloading.py Port tests to pytest 2016-08-19 13:19:38 +02:00
test_pickling.cpp Add dynamic attribute support 2016-10-11 22:13:02 +02:00
test_pickling.py Add dynamic attribute support 2016-10-11 22:13:02 +02:00
test_python_types.cpp Fix test compilation when both optional's exist 2016-12-14 20:40:49 +01:00
test_python_types.py Set maximum line length for Python style checker (#552) 2016-12-13 00:59:28 +01:00
test_sequences_and_iterators.cpp Fix test compilation failure under gcc 4.9 (#496) 2016-11-13 10:41:31 +09:00
test_sequences_and_iterators.py Add checks to maintain a consistent Python code style and prevent bugs (#515) 2016-11-20 21:21:54 +01:00
test_smart_ptr.cpp Allow references to objects held by smart pointers (#533) 2016-12-07 02:36:44 +01:00
test_smart_ptr.py Allow references to objects held by smart pointers (#533) 2016-12-07 02:36:44 +01:00
test_stl_binders.cpp Fix stl_bind to support movable, non-copyable value types (#490) 2016-11-15 12:30:38 +01:00
test_stl_binders.py Add checks to maintain a consistent Python code style and prevent bugs (#515) 2016-11-20 21:21:54 +01:00
test_virtual_functions.cpp Update OVERLOAD macros to support ref/ptr return type overloads 2016-09-11 01:21:53 -04:00
test_virtual_functions.py Set maximum line length for Python style checker (#552) 2016-12-13 00:59:28 +01:00