From 77ef03d5b136891fec8878bf8c6e7442ce75e903 Mon Sep 17 00:00:00 2001 From: Jeff VanOss Date: Tue, 11 Jun 2019 08:25:35 -0400 Subject: [PATCH] compile time check that properties have no py:arg values (#1524) --- include/pybind11/pybind11.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 76e243a93..ca0b1a709 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -1266,6 +1266,8 @@ public: /// Uses cpp_function's return_value_policy by default template class_ &def_property_static(const char *name, const cpp_function &fget, const cpp_function &fset, const Extra& ...extra) { + static_assert( 0 == detail::constexpr_sum(std::is_base_of::value...), + "Argument annotations are not allowed for properties"); auto rec_fget = get_function_record(fget), rec_fset = get_function_record(fset); auto *rec_active = rec_fget; if (rec_fget) {